Jun 17, 2016, 9:44 PM
[CLOSED] TagField clears store filter after select.
Hello.
TagField appears to be clearing the stores filters after a user makes a section.
This makes sense since since, I'm assuming, it uses filters when typing in the TagField to narrow down your selection options.
However, this store already has a filter.
After the selection is made, ext clears all filters, not just the filter it used to narrow the selections when typing.
And, there is no trigger for after the filters are cleared so I can re-apply it.
Any ideas or suggestions?
The TagField:
TagField appears to be clearing the stores filters after a user makes a section.
This makes sense since since, I'm assuming, it uses filters when typing in the TagField to narrow down your selection options.
However, this store already has a filter.
After the selection is made, ext clears all filters, not just the filter it used to narrow the selections when typing.
And, there is no trigger for after the filters are cleared so I can re-apply it.
Any ideas or suggestions?
The TagField:
<ext:TagField runat="server" StoreID="RecipientsStore" QueryMode="Local" DisplayField="Email" ValueField="Email" SelectOnTab="false" HideSelected="true">
<Listeners>
<BeforeQuery Handler="#{RecipientsStore}.filter({property:'EnterpriseCD', value:#{EnterpriseComboBox}.value, id:'EnterpriseCD'});"></BeforeQuery>
</Listeners>
</ext:TagField>
This is the EXT JS code, the "me.store.clearFilter();" line is giving the headache.onItemSelect : function (sm, record) {
var me = this;
if (me.ignoreSelection || !me.isExpanded) {
return;
}
me.inputEl.dom.value = "";
if (!me.createNewOnSelect) {
me.inputEl.dom.value = record.get(me.displayField);
if (me.collapseOnSelect !== false) {
me.collapse();
}
me.ignoreSelection++;
sm.deselect(record);
me.ignoreSelection--;
}
else {
me.addTagToInput(record);
if (me.collapseOnSelect === true) {
me.collapse();
}
}
me.fireEvent("select", me, record);
me.store.clearFilter();
me.inputEl.focus();
},
I could possibly fire on the firing on the select event with a 1ms delay, but this seems like a band-aid.<ext:TagField runat="server" StoreID="RecipientsStore" QueryMode="Local" DisplayField="Email" ValueField="Email" SelectOnTab="false" HideSelected="true">
<Listeners>
<BeforeQuery Handler="#{RecipientsStore}.filter({property:'EnterpriseCD', value:#{EnterpriseComboBox}.value, id:'EnterpriseCD'});"></BeforeQuery>
<Select Delay="1" Handler="#{RecipientsStore}.filter({property:'EnterpriseCD', value:#{EnterpriseComboBox}.value, id:'EnterpriseCD'});"></Select>
</Listeners>
</ext:TagField>
Thanks.
Last edited by CarlMGregory; Jun 17, 2016 at 10:32 PM.