0
votes

I have a comobobox in a form. The combobox has a remote store(with paging) as its a huge dataset.

The value of the combobox will be set by the form using the form.setValues(). At this point, the combobox's store is not loaded yet.

Now, How do display the value of the combobox, loading the store with the value set by form.

Is there a way that the store will autoload, with the set value as filter ? (something like filter on change)

Or

Do I have to manually listen for change and trigger it? (This im unable to achieve, as i end up in a mess, trying to setValue and handling different events.)

1
What version of extjs are you using? if it's extjs 5 or newer you can use databinding, and bind the value of the filter to the value of the datafield in the formSven Tore

1 Answers

0
votes

As far as I know (but I can be wrong), combobox and paging doesn't work together, because there's no way you can switch between pages in a combobox, and the combobox can't filter client-side because the filter cannot be applied to pages that are not loaded yet.

You would want to remove the paging and add remote filtering to the store instead. Then the dropdown should filter based on the value that is set in the combo. If I were you, I would also define a minimum length that the user has to type before anything is shown in the combo (e.g. 3), and then add have a beforeload event on the store that checks whether the length of the combo value is 3 or more.