1
我有一個GridPanel中,我在initComponet函數來創建店像ExtJS的電網 - 點擊與搜索條件翻頁按鈕
,initComponent: function() {
var store = Ext.create('Ext.data.Store', {
model: 'MyObject',
autoLoad: false,
pageSize:22,
remoteSort:true,
proxy: {
type: 'ajax',
url: 'example.php',
reader: {
type: 'json',
totalProperty: 'total',
root: 'results'
}
}
});
this.store = store;
this.dockedItems = [{
xtype: 'pagingtoolbar',
store: this.store,
displayMsg: '{0} - {1}/{2}',
emptyMsg: 'empty',
dock: 'bottom',
displayInfo: true,
pageSize: 22
}];
this.callParent(arguments);
this.store.load({params:{start:0, limit:22}});
}
我做了一些價值形式的搜索,當我按下搜索按鈕,下面我會做代碼
grid.store.load({
params:{
start:0,
limit:22,
signalSearch: 1,
search1: myValue1,
search2: myValue2,
}
});
在我的PHP文件將趕上知道這是搜索
if (have $_REQUEST["signalSearch"]) {
// print json with condition search
}else {
// print json with all data
}
的d結果返回2頁(好)。但是,當我按下一頁按鈕看到第2頁上的一些結果但我的商店負載失敗(我認爲他們打電話store.load({params:{start:0, limit:22}});
當我按下一頁按鈕和我的PHP文件,將與其他案件運行)。
這不叫
grid.store.load({
params:{
start:0,
limit:22,
search1: myValue1,
search2: myValue2,
}
});
我的想法做搜索不是很好嗎?我該如何解決,謝謝