Ext Js Combo Filter by individual elements

I have two requirements to link EXT Js compilation

- The first element in the combo must have fixed text, such as "Unfilterd"

- After that, I need to associate the data warehouse with the combo above. The values ​​of column A were restored to the data store, so how can you filter the data store so that it has different rows in column A before combining the combo.

Note:

I use the data warehouse to link the grid as well, I do not want to create another call in the database. This is the reason why I am looking for a solution to filter data using Ext Js datastore.

My sample code below

extManager1.comboFilter = new Ext.form.ComboBox({ editable: false , id: 'BaseTemplate' , fieldLabel: 'Base Templates' , name: 'BaseTemplate' , editable: false , store: extManager1.GetTemplateDetails , displayField:'FilterBy' , valueField: 'value' , mode: 'local' , boxLabel: 'BaseTemplate' , typeAhead: true , triggerAction: 'all' , forceSelection: true , selectOnFocus: true , emptyText:'Unfilterd' ,listeners:{select:{fn:function(combo, value) { //This code filters the grid panel data by selected combo value Ext.getCmp('TemplateGridPanel').store.filter('productdisplayheading', combo.getValue()); }} } }); 
+3
source share
1 answer

You will probably need to create another store object with the right content. But there is no need to retrieve data from the database - you can populate the new repository with data in your extManager1.GetTemplateDetails repository. Take a look at the collection method in ExtJS Store - it can be used to retrieve various values ​​from an existing repository.

+2
source

Source: https://habr.com/ru/post/1433837/


All Articles