Page 1 of 1

Preset Search

PostPosted: 12 Jul 2017 22:59
by mrcarver
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

Re: Preset Search

PostPosted: 13 Jul 2017 11:39
by Alexander Bulei
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.

Re: Preset Search

PostPosted: 13 Jul 2017 15:27
by mrcarver
Worked awesome.

THANK YOU VERY MUCH