1

I'm currently trying to display a list in sencha with data from a store. When I fire an ajax request and update this store the changes are reflected in the list (the right numbers are changed), but it doesn't re-sort the list. The list is sorted at the first load, but then never again. Does anybody know how to re-sort the list after an update? I've tried with adding a listener to refresh and resorting my store from there, but that doesn't help.

Thank you!

4

1 に答える 1

0

pull to refresh プラグインを使用しているかどうかわかりません。私は、更新メソッドが行ったことをオーバーライドする必要がありました(ドキュメントに従って):

    plugins: [
        {
            xclass: 'Ext.plugin.PullRefresh',
            pullRefreshText: 'Refresh',
            refreshFn: function() {
                this.getList().setMasked(true);
                this.getList().getStore().load();
            }
        }
    ]

追加の mask 呼び出しは、リストをマスクするためにあります。これは、pull to refresh がそれ自体を非表示にする前にデータが返されるのを待たないためです (リストが既に更新されているという誤った印象を与えます)。

于 2013-02-26T03:52:18.287 に答える