2014-03-18 105 views
0

我正在使用extjs網格,我發現對於過濾器,我們必須爲remote設置local = false。一旦數據加載到網格中,我希望它從網格中過濾掉,而不是每次都打到數據庫。Extjs3.2網格過濾器localy

如何做到這一點?

感謝

回答

0

你試過local: true財產?如果你設置了local: false將會工作遠程數據。以下是來自Sencha例子的一個例子。

var filters = new Ext.ux.grid.GridFilters({ 
    encode: false, // // configure whether filter query is encoded or not (initially) 
    local: true, // defaults to false (remote filtering) 
    filters: [{ 
     type: 'numeric', 
     dataIndex: 'id' 
    }, { 
     type: 'string', 
     dataIndex: 'company', 
     disabled: true 
    }, { 
     type: 'numeric', 
     dataIndex: 'price' 
    }, { 
     type: 'date', 
     dataIndex: 'date' 
    }, { 
     type: 'list', 
     dataIndex: 'size', 
     options: ['small', 'medium', 'large', 'extra large'], 
     phpMode: true 
    }, { 
     type: 'boolean', 
     dataIndex: 'visible' 
    }] 
});