gpt4 book ai didi

ExtJs 4.2.0.663 使用 Searchfield 导致异常 "PageMap asked for range which it does not have"

转载 作者:行者123 更新时间:2023-12-04 21:19:24 26 4
gpt4 key购买 nike

因为 ExtJS 4.2 在缓冲网格(无限网格)上使用过滤器似乎有一个错误,我重写了我的代码,现在我只是使用一个简单的搜索字段让用户搜索整个网格的数据。
只要找到了一些东西,它就可以完美运行,但如果没有找到任何东西,ext 就会崩溃并出现异常
“页面 map 要求它没有的范围”

我的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);
}
}
});

我的搜索字段,位于工具栏:
 this._moduleToolbar = {
xtype: 'toolbar',
itemId: 'activityLogmanagerToolbar',
items: [{
iconCls: 'icon-arrow_refresh',
text: '@menu_reload@',
itemId: 'btnReload',
scope: this,
handler: function () {
// reset list display to top to avoid corrupted display
Ext.getCmp('activityLogmanagergrid').store.load();
}
}, {
iconCls: 'icon-cross',
text: '@menu_deleteAllActivityLog@',
itemId: 'btnDeleteAll',
scope: this,
handler: this.DeleteAllActivityLog
}, '->', {
width: 300,
fieldLabel: 'Search',
labelWidth: 50,
xtype: 'searchfield',
store: scope._store
}
]
};

请帮忙 ...

最佳答案

我也有这个问题。我在他们的论坛上发帖(和其他人一样)并开了一张支持票。他们没有为 Ext JS 4.2 提出解决方案,但该错误(以及缓冲存储中的许多其他错误)在 4.2.1 版本中得到修复。我认为那里几乎重建了大部分代码,所以他们没有选择为 4.2 制作廉价的修补程序。

在我可以迁移到 4.2.1 之前,我用 try-catch 块包装了我所有的查找记录调用。我也尝试在第 3383 行覆盖 Store.js 中的 getRange 函数,但它属于内部 PageMap 类,所以这是没有选择的。

关于ExtJs 4.2.0.663 使用 Searchfield 导致异常 "PageMap asked for range which it does not have",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15520360/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com