CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Preset Search

by mrcarver » 12 Jul 2017 22:59

CG Gurus,

When setting MyCGDropDown.JQDropDownOptions.Open(), how can I preset the search;.value. So, for example if MyCGDropDown contains a list of US States, how can I preset the search option to the value "wa" ?

Regards,
Monte Carver
mrcarver
 
Posts: 70
Joined: 05 Jun 2012 10:51

by Alexander Bulei » 13 Jul 2017 11:39

Hi mrcarver,

When setting MyCGDropDown.JQDropDownOptions.Open(), how can I preset the search;.value. So, for example if MyCGDropDown contains a list of US States, how can I preset the search option to the value "wa" ?


You can do it by following code:

delphi code
procedure TIWFormDashboardUserOrder.IWDropDownJQDropDownOptionsOpen(Sender: TObject; AParams: TStringList);
var
s: string;
begin
s:= Format('%s.data("select2").search.val("%s").trigger("input");',[IWDropDown.GetIDJQuery, 'wa']);
CGAddJavaScriptToAjaxResponse(s);
end;


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 mrcarver » 13 Jul 2017 15:27

Worked awesome.

THANK YOU VERY MUCH
mrcarver
 
Posts: 70
Joined: 05 Jun 2012 10:51


Return to JQDropDown

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.