I am planning to use http://www.objis.com/formationextjs/lib/extjs-4.0.0/docs/api/Ext.data.Store.html to store a table and filter the data… For instance the table sales: Product | Branch | Quantity | Earning | …
Suppose the data for quantity and earning are range of values, such as: less than 100, between 101 and 200, etc. and I use a ComboBox for each column to filter the data: Product combobox, Branch combobox,…
My design has a global Store to hold the table, and one Store per ComboBox.
I know I can use the event/listener Select in the ComboBox to apply the filters. Additional, use the datachanged of the global Store to set the data in the other stores.
My question is: How to get/select/extract a column from the global Store and applies distinct and sort operations to set the data in each combobox-store???
Update
Example http://jsfiddle.net/jQXf7/6/
I worked out the solution using
collectmethod of the store and usingExt.data.ArrayReaderfor theComboBoxStores.Collect: Collects unique values for a particular dataIndex from this store.Ext.data.ArrayReader: Data reader class to create an Array of Ext.data.Record objects from an Array.Solution: http://jsfiddle.net/jQXf7/10/ (simple implementation of one filter at the time)