【问题标题】:DGRID not sortingDGRID 未排序
【发布时间】:2015-12-01 18:52:58
【问题描述】:

我有一个带有指定 dstore/内存存储的 dojo dgrid

_instance = new Memory({
    data: {
        identifier:'monthNumeric', 
        items: []
        }
    });

当我单击网格的标题时,我看到排序箭头发生了变化,但网格中的内容没有变化。

我跟踪了代码,并看到它构建了一个排序对象。然后它从 _StoreMixins.js 调用这段代码

_applySort: function () {
        if (this.collection) {
            this.set('collection', this.collection);
        }
        else if (this.store) {
            console.debug('_StoreMixin found store property but not collection; ' +
                'this is often the sign of a mistake during migration from 0.3 to 0.4');
        }
    },

集合的设置看似创建了排序函数,但实际上并没有执行。

这应该如何工作?

(我不知道这是否重要,但同一个商店也用于 Dojo 图表,包装在 DStoreAdapter 中。但这不是这里的使用方式)

【问题讨论】:

  • dgrid.io 上的示例演示了排序工作(包括首页上的功能网格)。你能提供一个可运行的例子来说明它不可以吗?
  • 在尝试创建 jsfiddle 时,我发现 1.0.0 和 1.1.0 之间的更改影响了我的代码

标签: dojo dgrid dstore


【解决方案1】:

dgrid 1.1.0 在 setCollection 中围绕刷新添加了对 _started 的检查

由于我从未在网格上启动过,因此没有设置。一旦我启动启动,一切都按预期工作

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-01-23
    • 2012-09-03
    • 1970-01-01
    • 1970-01-01
    • 2013-01-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多