【问题标题】:ExtJs GroupingView prevent sorting of the group titleExtJs GroupingView 防止对组标题进行排序
【发布时间】:2011-06-01 19:39:11
【问题描述】:

如何防止在 GroupingView 中对组标题进行排序。默认情况下,组标题按“ASC”排序。我有一种情况,“临时报告”组应该在 GroupingView 中排在最后。

我需要按以下顺序排列组标题

groupName: '联邦报告' groupName: '状态报告' groupName: '临时报告'

这就是它们在 JSON 中的分组方式。

【问题讨论】:

  • 你找到答案了吗?

标签: extjs


【解决方案1】:

尝试在您的商店中开启remoteSort

编辑

另外尝试将groupOnSort 设置为falseremoteGroup 设置为true

【讨论】:

  • 没有运气使用 remoteSort。我的 JSON 数据没有远程加载。 { rows: [{ groupName: 'Federal Reports', id: 'F_FICA', title: 'EEs with Medicare/OASDI ?无预扣税”,描述:“识别任何员工”},{ groupName:“联邦报告”,标题:“OASDI 税? No Wages', description: 'Compares Federal Unemployment' },{ groupName: 'State Reports', title: 'Fica EE and ER Wages', description: 'List any employees' },{ groupName: 'Ad Hoc Reports', title : '负收益', 描述: 'List of any ' }] }
  • 我猜,组标题 (groupName) 出于分组原因首先排序,以便将这些组中的字段组合在一起。有没有办法为组指定 sortType?
  • 仍然没有运气 - groupOnSort 为假,remoteGroup 为真
  • 好的——那么我们应该看看你的代码。请发布一个尽可能简洁但复制您的问题的代码 sn-p。
【解决方案2】:

我不确定,老实说我无法仔细阅读您的帖子,但这可能会对您有所帮助。顺便说一句,我在 Ext PropertGrid 上处理过类似的问题,这很头疼。 Disable auto sorting on property grid in ExtJS

【讨论】:

  • API 中定义的排序属性,适用于每个组下的字段。但是 Groups 本身没有排序功能。要么,我遗漏了一些东西,要么可能无法为组定义排序顺序
【解决方案3】:

所以我设置了remoteGroup: true,并在我的服务器端通过 SQL 对数据进行了排序。

此处描述了类似的问题: Sorting the Grouped data in GridPanel

【讨论】:

    猜你喜欢
    • 2015-05-22
    • 1970-01-01
    • 1970-01-01
    • 2021-03-08
    • 2017-09-01
    • 2014-04-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多