View Full Version : Autosuggest with multi select - trigger search for new query string keeping records

18 Oct 2013, 7:47 AM
I am trying to build auto suggest feature using combobox. Requirement is as below -
1. Auto suggest textbox we should allow multi-select - by keeping multiSelect=true, hideTrigger=true and remote query this is satisfied.
2. After selecting elements from suggest flyout, user can again type X characters in the textbox after comma delimiter and search should be performed again and only the results having the new keyword (i.e. querystring = value post last comma) should be listed.
To satisfy second requirement, I need to fire query for last query string entered by user which can be done by handling beforequery event, setting queryPlan.query value to last querystring. Search works fine, but store doesn't keep the old selected values since new query does not retrieve the records for previous searches and hence store will have records for last query only.
How can we keep the previous searched records in memory but still trigger search for last input value? I tried setting clearOnPageLoad to false but it doesn't work. One option I think could work is to get results for all the input strings and then apply filter for last querystring on UI side once store is loaded. But this will result in unnecessary querying backend when I already have records in my store retrieved.
Please suggest if there is any setting which will prevent clearing store data when combo fires remote query call.
Thanks in advance for any suggestions!

20 Oct 2013, 8:59 PM
Any suggestions please.

21 Oct 2013, 1:35 AM
You want to show selected records from different queries? That's not possible without manual store filling.