【问题标题】:Extjs remoteSorting in grid网格中的 Extjs 远程排序
【发布时间】:2013-06-22 14:38:28
【问题描述】:

当我尝试打开 RemoteSorting 时,我遇到了问题,然后排序完全可以工作。当我不打开它时,我可以排序,但只能在网格中显示数据,而不是所有来自基础的数据。

有人看到有什么问题吗?请帮助它的重要

var contact = Ext.data.Record.create([
   {name: 'ID', mapping: 'ID'},
   {name: 'Name', mapping: 'Name'},
   {name: 'LastName', mapping: 'LastName'}

])

var store = new Ext.data.Store({
            remoteSort: true,

            proxy: new Ext.data.HttpProxy({
                url: '../../Users/Info',
                dataType: 'json',
                method: 'GET',
                headers: { "Content-Type": "application/json; charset=utf-8" }
            }),
            reader: new Ext.data.JsonReader({

                root: 'data',
                dataType: 'json',
                idProperty: 'prodID',
                totalProperty: 'totalCount'

            },
                    ProductsType

            ),

            writer: new Ext.data.JsonWriter({
                encode: false,
                listful: true,
                writeAllFields: true
            })

        });
})

【问题讨论】:

    标签: asp.net-mvc-3 sorting extjs grid extjs3


    【解决方案1】:

    启用远程排序后,您将所有排序职责委派给服务器端应用程序,该应用程序控制数据返回到您的网格。理解这一点很重要,因为当打开 remoteSort 时,网格的存储实际上对排序状态一无所知。

    因此,如果您想要远程排序,则必须确保在 asp.net 端处理排序。通常,这将通过您正在使用的 SQL 查询来完成。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-02-12
      • 1970-01-01
      • 2023-03-27
      • 2012-02-27
      • 2015-10-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多