CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Item Index

by O.Germeau » 17 Sep 2013 12:00

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 ?
O.Germeau
 
Posts: 50
Joined: 13 Sep 2013 12:32

by Alexander Bulei » 17 Sep 2013 14:38

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.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by O.Germeau » 22 Oct 2013 10:39

Thanks, this is work perfectly
O.Germeau
 
Posts: 50
Joined: 13 Sep 2013 12:32


Return to JQAutoComplete

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.