5
因爲ExtJS 4.2似乎有一個在緩衝網格(無限網格)上使用過濾器的錯誤,我重寫了我的代碼,現在我只是使用簡單的搜索字段讓用戶搜索網格的所有數據。 只要事情是找到它的作品完美,但如果什麼也沒有發現分機崩潰,異常 「頁地圖要求範圍內,它不具有」ExtJs 4.2.0.663使用Searchfield結果異常「PageMap要求的範圍,它沒有」
我的javascript「包括」
<script type="text/javascript" src="/js/ext-4.2.0.663/examples/ux/grid/filter/Filter.js"></script>
<script type="text/javascript" src="/js/ext-4.2.0.663/examples/ux/grid/filter/BooleanFilter.js"></script>
<script type="text/javascript" src="/js/ext-4.2.0.663/examples/ux/grid/filter/DateFilter.js"></script>
<script type="text/javascript" src="/js/ext-4.2.0.663/examples/ux/grid/filter/ListFilter.js"></script>
<script type="text/javascript" src="/js/ext-4.2.0.663/examples/ux/grid/filter/NumericFilter.js"></script>
<script type="text/javascript" src="/js/ext-4.2.0.663/examples/ux/grid/filter/StringFilter.js"></script>
<script type="text/javascript" src="/js/ext-4.2.0.663/examples/ux/grid/menu/ListMenu.js"></script>
<script type="text/javascript" src="/js/ext-4.2.0.663/examples/ux/grid/menu/RangeMenu.js"></script>
<script type="text/javascript" src="/js/ext-4.2.0.663/examples/ux/grid/FiltersFeature.js"></script>
<script type="text/javascript" src="/js/ext-4.2.0.663/examples/ux/grid/TransformGrid.js"></script>
<script type="text/javascript" src="/ASDB4/js/ext-4.2.0.663/examples/ux/form/SearchField.js"></script>
我的商店:
this._store = Ext.create('Ext.data.Store', {
storeId: 'ActivityLogStore',
model: 'ActivityLogModel',
remoteGroup: true,
autoDestroy: true,
buffered: true,
remoteSort: true,
leadingBufferZone: 300,
pageSize: 100,
autoLoad: true,
proxy: {
type: 'ajax',
url: '~myurl~',
reader: {
root: 'data[0].sActivityLogsArr',
totalProperty: 'data[0].totalcount'
},
simpleSortMode: true,
simpleGroupMode: true,
groupParam: 'sort',
groupDirectionParam: 'dir',
filterParam: 'searchString',
encodeFilters: function (filters) {
return filters[0].value;
}
},
listeners: {
// This particular service cannot sort on more than one field, so if grouped, disable sorting
groupchange: function (store, groupers) {
var sortable = !store.isGrouped(),
headers = grid.headerCt.getVisibleGridColumns(),
i, len = headers.length;
for (i = 0; i < len; i++) {
headers[i].sortable = (headers[i].sortable !== undefined) ? headers[i].sortable : sortable;
}
},
beforeload: function() {
// remove any selections - otherwise store loading crashes (another bug in extjs ...?)
Ext.getCmp('activityLogmanagergrid').getSelectionModel().clearSelections();
},
// This particular service cannot sort on more than one field, so if grouped, disable sorting
beforeprefetch: function (store, operation) {
if (operation.groupers && operation.groupers.length) {
delete operation.sorters;
}
},
load: function() {
Ext.getCmp('activityLogmanagergrid').verticalScroller.scrollTo(0);
}
}
});
我searchfield,位於工具欄:
this._moduleToolbar = {
xtype: 'toolbar',
itemId: 'activityLogmanagerToolbar',
items: [{
iconCls: 'icon-arrow_refresh',
text: '@[email protected]',
itemId: 'btnReload',
scope: this,
handler: function() {
// reset list display to top to avoid corrupted display
Ext.getCmp('activityLogmanagergrid').store.load();
}
}, {
iconCls: 'icon-cross',
text: '@[email protected]',
itemId: 'btnDeleteAll',
scope: this,
handler: this.DeleteAllActivityLog
}, '->', {
width: 300,
fieldLabel: 'Search',
labelWidth: 50,
xtype: 'searchfield',
store: scope._store
}
]
};
請幫助...
沒有人利用無限網格嗎? – timTaylor 2013-03-26 06:06:41
請使用通用extjs標籤標記您的ext js問題 - 除了版本標籤。沒有人遵循extjs4.2! – 2013-04-09 23:01:58