[英]ExtJS: Grid Filtering in 4.2.1 (Upgrade Breakage)
我有一個網格過濾設置,可以在ExtJS 4.1.1.1中正常工作,但是當我嘗試升級到4.2.1.883時,我的網格過濾器不再起作用,我完全不解為什么。 我想升級,因為4.2.x對我們而言明顯更快。 我正在使用MVC設置,並嘗試以編程方式訪問網格的篩選器。 也許有人可以幫忙! 這是我得到的:
// The Filters
var listFilters = {
ftype: 'filters',
autoReload: true,
local: false,
encode: 'encode',
updateBuffer: 750,
filters: [
{ type: 'numeric', dataIndex: 'id' },
{ type: 'string', dataIndex: 'title' }
]
};
// The Columns
var listColumns = [
{
id: 'id',
text: 'ID',
dataIndex: 'id',
width: 150,
filterable: true,
filter: { type: 'numeric' }
},
{
id: 'title',
text: 'Title',
dataIndex: 'title',
width: 75,
filterable: true,
filter: { type: 'string' }
}
];
// The Grid
Ext.define('JP.view.asset.List', {
extend: 'Ext.grid.Panel',
alias: 'widget.assetlist',
id: 'grid',
store: 'Assets', // referenced from another js file, per MVC
layout: 'fit',
features: [ listFilters ], // filters referenced here
columns: listColumns, // columns referenced here
listeners: {
afterrender: function(grid) {
// This works in 4.1.1, does nothing in 4.2.1
grid.filters.createFilters();
// ^^ Cannot call method 'createFilters' of undefined
// :( :(
// Can no longer reference `grid.filters` externally either, e.g.,
// from Ext.tree
}
}
});
有任何想法嗎?! 我完全被困在這里。 grid.filters不再可以通過編程方式訪問,也不能再從GUI加載(從列下拉列表中)。 在4.1.x中正常工作。
當然,我已經加載了正確的路徑,依此類推...
// Load Ext.js MVC Application
Ext.Loader.setConfig({
enabled: true,
paths: { 'Ext.ux': 'javascript/ext-4.2.1/examples/ux' }
});
Ext.require([
'Ext.grid.*',
'Ext.data.*',
'Ext.tree.*',
'Ext.ux.*',
'Ext.ux.grid.FiltersFeature'
]);
沒有這種運氣。 好像ftype: 'filters'
被網格的features
參數完全忽略了。
謝謝!!!
這是我們4.2環境中應用程序的相關代碼段。
Ext.application({
...
, paths: {'Ext.ux': '../[Path to ext]/src/ux/' }
, requires: [
'Ext.ux.grid.FiltersFeature'
]
...
});
過濾器就像魅力一樣工作。
路徑應為resources/ux
或者如果您要使用examples目錄中可用的文件,請使用examples/ux/grid
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.