Page 1 of 1

Item Index

PostPosted: 17 Sep 2013 12:00
by O.Germeau
I use autocomplete on Intraweb XIV via ajax with XE4.
For the popup, i use OnGetAutoCompleteDataEx. All work well and the displays is ok.
In this event i stock object pointer in a Tlist with the same index that the TStrings Adata.
When the user select a item, i use the event AutoCompleteOptionsSelect.
My question : How access the item number select ? Is it possible ?

Re: Item Index

PostPosted: 17 Sep 2013 14:38
by Alexander Bulei
Hi O.Germeau ,

You should use OnGetAutoCompleteData event (you can see example in our demo).
At this event, you can add additional properties for item:

delphi code
ItemJSon:= SO();
ItemJSon.I['uid']:= uniqueId; //additional parameter for OnSelect event
ItemJSon.S['value']:= itemValue; //required
ItemJSon.S['label']:= itemCaption; //required


Then, add new browserParam item to event (You can put this code on create or directly in delphi designer):

delphi code
BrowerParam:= IWCGJQAutoComplete.JQAutoCompleteOptions.OnSelect.BrowserParams.Add;
BrowerParam.ServerName:= 'myuid';
BrowerParam.BrowserScript:= 'ui.item.uid';



Last thing what you need to do, get this param inside OnSelect event:

delphi code
MyUID:= StrToInt(AParams.Values['myuid']);



Best Regards.

Re: Item Index

PostPosted: 22 Oct 2013 10:39
by O.Germeau
Thanks, this is work perfectly