【问题标题】:Is there a way to sort the grouping method name in JQgrid?有没有办法在 JQgrid 中对分组方法名称进行排序?
【发布时间】:2014-02-11 12:38:29
【问题描述】:

有没有办法对分组方法名称进行排序,而不是 desc 和 asc (groupOrder: ['desc'])。我有两列:id 和 status

id     status
1  |   StatusA
2  |   StatusZ
3  |   StatusB

我在状态之后进行分组,我可以在状态之后排序,但我想在 id 之后排序。我怎样才能做到这一点? 我试过这个方法:

groupOrder: ['idName','asc'] 

其中 idName 代表 id 来自

部分代码:

 grouping:true,
        groupingView : {
            groupField : [grup],
            groupSummary : [true],
            groupColumnShow : [true],
            groupText : ['<b>{0}</b>'],
            groupCollapse : false,
            groupOrder: ['asc'] 
        },

【问题讨论】:

    标签: sorting jqgrid grouping


    【解决方案1】:

    编辑

    我稍微修改了你的代码块。您的 groupField 没有指定您的 id 列,所以我补充说:

    grouping:true,
    groupingView : {
        groupField : ['id'],
        groupSummary : [true],
        groupColumnShow : [true],
        groupText : ['<b>{0}</b>'],
        groupCollapse : false,
        groupOrder: ['asc'] 
    },
    

    这有帮助吗?

    【讨论】:

    • @Chester 我也刚刚编辑了我的,如果有帮助请告诉我
    猜你喜欢
    • 2021-03-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-12
    • 2020-03-28
    • 1970-01-01
    • 2019-03-04
    • 2015-11-29
    相关资源
    最近更新 更多