Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Take a look on to ExtJS. It has the object "store", which is able to store structured data and allow to do manipulations with it, like sorting, filtering, querying. For example your task could be resolved like that:</p> <pre><code>Ext.application({ name: 'HelloExt', launch: function() { Ext.create('Ext.data.Store', { storeId:'UsersStore', model: 'User', fields: [ 'id', 'name', 'title', 'filter1', 'filter2', 'filter3' ], data: [ { name: 'Ed', title: 'CEO', filter1: true, filter2: false, filter3: true }, { name: 'Tommy', title: 'CTO', filter1: false, filter2: false, filter3: false }, { name: 'Aaron', title: 'COO', filter1: true, filter2: true, filter3: true }, { name: 'Jamie', title: 'CFO', filter1: true, filter2: true, filter3: false } ] }); function filterStore() { var store = Ext.data.StoreManager.lookup('UsersStore'); store.clearFilter(); store.filter([ { property: 'filter1', value: Ext.getCmp('Filter1CB').getValue() }, { property: 'filter2', value: Ext.getCmp('Filter2CB').getValue() }, { property: 'filter3', value: Ext.getCmp('Filter3CB').getValue() } ]); } Ext.create('Ext.container.Viewport', { layout: 'vbox', layoutConfig: { vbox: { align: 'stretch' } }, items: [ { xtype: 'panel', border: false, padding: 10, items: { flex: 1, xtype: 'fieldcontainer', items: [ { fieldLabel: 'Filter1', xtype: 'checkbox', id: 'Filter1CB', handler: filterStore }, { fieldLabel: 'Filter2', xtype: 'checkbox', id: 'Filter2CB', handler: filterStore }, { fieldLabel: 'Filter3', xtype: 'checkbox', id: 'Filter3CB', handler: filterStore } ] } }, { flex: 1, xtype: 'gridpanel', title: 'Users', store: Ext.data.StoreManager.lookup('UsersStore'), columns: [ { header: 'Name', dataIndex: 'name' }, { header: 'Title', dataIndex: 'title' } ] } ] }); } </code></pre> <p>});</p> <p>Fiddle: <a href="http://jsfiddle.net/Q55ym/1/" rel="nofollow">http://jsfiddle.net/Q55ym/1/</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload