带列表的ExtJS remoteFilter不起作用

时间:2017-06-12 15:01:03

标签: extjs6

我有一个remoteFilter: true商店,当我加载结果并排序时,我从远程源获得了正确的响应,但是当我尝试过滤一个值时,我在控制台中看到错误

TypeError: Cannot read property 'items' of null

我可以在服务器的响应中看到过滤正在正确发送和接收。

在我的网格列中,我有以下内容(假值 - 我正在手动输入它们,因为我的代码在内部网上):

{ text: 'Header Whatever', dataIndex: 'status', filter: { type: 'list', dataIndex: 'remoteStatus',//the value from the remote source is different from my model (changing it doesn't fix it) single: true, options: [ 'visible', 'invisible' ] } }

对其他列中的文本字符串进行过滤可以正常工作,如果没有结果,我不会收到错误。过滤我的自定义选项会调用并从远程源获取正确的响应,但是我收到错误并且加载掩码不会消失。

所有远程排序工作和使用字符串过滤都有效。不幸的是,我必须为要过滤的用户提供一个值列表,因此在这里使用字符串过滤器是不可能的。

我缺少什么想法?我正在使用ExtJS 6.0.1。我已经在Sencha的论坛上发布了这个问题,但那里没有太多的支持。

1 个答案:

答案 0 :(得分:0)

好的......我认为这个问题可能与加载列表商店有关。我正在定义一个新的列表存储,但我想它没有被实例化。通过变量添加商店,我可以加载

var mystore = Ext.create('Ext.data.Store', {
    fields: ['id'],
    data: [
        { id: 'invisible'},
        { id: 'visible'}
    ]
});

....

filter: {
    type: 'list',
    store: mystore,
    idField: 'id',
    labelField: 'id',
    dataIndex: 'remoteStatus',
    ....