May 28, 2014, 6:47 PM
[CLOSED] Local Filtering on ComboBox
Is there a sample showing a way to apply a local filter on a ComboBox, similar to the
I have a data model in which there are Items, Varieties, and Types.
* Each Item belongs to one Variety, each Variety has one or more Items.
* Each Variety belongs to one Type, and each Type has one or more Varieties.
* Items can be moved from Variety to another, as long as the two Varieties belong to the same Type.
So I am working on a form for shifting items from one Variety to another.
I have a Store for the Varieties I am working with, called the "SelectedVarietiesStore." It is populated in JavaScript using an Add function that works well. The store is defined like this:
There is a grid that shows the values from this store, and a context menu item that allows me to selected a Variety and move items from that Variety to a related one of the same Type. If I select this menu item, it opens a form with two ComboBoxes, the FromVariety and ToVariety, passing the VarietyID and the TypeID of the selected Variety to the form:
Because the SelectedVarietiesStore is populated locally, and not from a database, I do not want to do an Ajax or Postback to bind this ComboBox, I want to filter the values already in the store.
I believe that I am supposed to use the Query functionality to do this, but I can't find an example that matches what I'm trying to do. I looked at http://forums.ext.net/showthread.php...-in-local-mode, but I can't figure out who what is going on there would apply to my situation.
Any suggestions or examples would be appreciated. Thanks!
<ext:GridFilters Local="true" />
feature on GridPanels? I ask because I have a store which is modified and filtered locally in a grid panel and, if possible, I would like to display filtered data from that store in a combobox without using the code behind and without modifying the store.I have a data model in which there are Items, Varieties, and Types.
* Each Item belongs to one Variety, each Variety has one or more Items.
* Each Variety belongs to one Type, and each Type has one or more Varieties.
* Items can be moved from Variety to another, as long as the two Varieties belong to the same Type.
So I am working on a form for shifting items from one Variety to another.
I have a Store for the Varieties I am working with, called the "SelectedVarietiesStore." It is populated in JavaScript using an Add function that works well. The store is defined like this:
<ext:Store ID="SelectedVarietiesStore" runat="server" AutoDestroy="false" runat="server" AutoLoad="false" AutoDataBind="false" ClientIDMode="Static">
<Proxy>
<ext:PageProxy NoCache="true" />
</Proxy>
<Model>
<ext:Model ID="SelectedVarietiesModel" runat="server" ClientIDMode="Static">
<Fields>
<ext:ModelField Name="VarietyName" Type="String" />
<ext:ModelField Name="VarietyID" Type="Int" />
<ext:ModelField Name="TypeID" Type="Int" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
There is a grid that shows the values from this store, and a context menu item that allows me to selected a Variety and move items from that Variety to a related one of the same Type. If I select this menu item, it opens a form with two ComboBoxes, the FromVariety and ToVariety, passing the VarietyID and the TypeID of the selected Variety to the form:
<ext:ComboBox ID="FromVarietyBox" runat="server" QueryMode="Local" Editable="false" StoreID="SelectedVarietiesStore" DisplayField="VarietyName" ValueField="VarietyID" FieldLabel="From Variety"></ext:ComboBox>
<ext:ComboBox ID="ToVarietyBox" runat="server" QueryMode="Local" Editable="false" StoreID="SelectedVarietiesStore" DisplayField="VarietyName" ValueField="VarietyID" FieldLabel="To Variety"></ext:ComboBox>
Now, the second ComboBox should be filtered to show only values which DO have the TypeID passed to the form, but do NOT have the VarietyID passed to the form (because I am constraining the target Variety to only those Varieties of the same Type which are not of the same Variety).Because the SelectedVarietiesStore is populated locally, and not from a database, I do not want to do an Ajax or Postback to bind this ComboBox, I want to filter the values already in the store.
I believe that I am supposed to use the Query functionality to do this, but I can't find an example that matches what I'm trying to do. I looked at http://forums.ext.net/showthread.php...-in-local-mode, but I can't figure out who what is going on there would apply to my situation.
Any suggestions or examples would be appreciated. Thanks!
Last edited by Daniil; Jun 06, 2014 at 6:29 PM.
Reason: [CLOSED]