Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sorting jqGrid服务器端分组排序_Sorting_Jqgrid_Grouping - Fatal编程技术网

Sorting jqGrid服务器端分组排序

Sorting jqGrid服务器端分组排序,sorting,jqgrid,grouping,Sorting,Jqgrid,Grouping,我有一个使用分组的jqGrid。数据的排序和分页是由服务器端完成的,因为我有太多的行,所以loadonce不是我的选项。 我遇到的问题是,传递给服务器的sidx参数是错误的,它也包含sord参数和重复的sidx,因此服务器在表中找不到该列 我意识到,如果我对分组进行评论,sord和sidx将恢复正常 这是我的代码: jQuery("#grid-destinations").jqGrid({ url:'destinations', datatype: "json", colModel:

我有一个使用分组的jqGrid。数据的排序和分页是由服务器端完成的,因为我有太多的行,所以loadonce不是我的选项。 我遇到的问题是,传递给服务器的sidx参数是错误的,它也包含sord参数和重复的sidx,因此服务器在表中找不到该列

我意识到,如果我对分组进行评论,sord和sidx将恢复正常

这是我的代码:

jQuery("#grid-destinations").jqGrid({
  url:'destinations',
  datatype: "json",
  colModel:[
            {name:'id', hidden:true},
            {name:'cliDestination', jsonmap: 'cliDestination.destinationDesc', index: 'cliDestination', label:'Destination', width:55},
            {name:'orgSub', jsonmap: 'orgSub.subscriptionId', label:'Client', width:55, summaryTpl:''},
            {name:'numCalls', label:'Calls', width:55, formatter:'number', summaryType:'sum'},
            {name:'orgSeconds', label:'Client Minutes', width:55, formatter:'number', summaryType:'sum'},
            {name:'aloc', label:'ALOC', width:55, formatter: 'number', summaryType:'avg', summaryRound: 2, summaryRoundType:'round'},
            {name:'currency', jsonmap: 'orgSub.btsAccount.accountCurrency.currencySymbol', label:'Currency', width:55, summaryTpl:''},
            {name:'saleRate', label:'Sell rate', width:55, summaryType:'avg', summaryRound: 4, summaryRoundType:'round'},
            {name:'income', label:'Income', width:55, summaryType:'sum'},
            {name:'purchaseRate', label:'Cost rate', width:55, summaryType:'avg', summaryRound: 4, summaryRoundType:'round'},
            {name:'cost', label:'Cost', width:55, summaryType:'sum'},
            {name:'profit', label:'Profit', width:55, summaryType:'sum'},
            {name:'percentageProfitIncome', label:'%Prof/Income', width:55, summaryType:'avg', summaryRound: 2, summaryRoundType:'round'}
        ],
  autowidth: true,
  gridview: true,
  viewrecords: true,
  sortname: "cliDestination",
  sortorder: "asc",
  rowNum:100,
        rowList:['All','100','500','1000'],
        pager: '#pager-destinations',
        emptyrecords: "Nothing found to display",
        jsonReader: {
            root: 'content',
            id: 'id',
            repeatitems: false,
            total: 'totalPages',
            records: 'totalElements'
        },
  // grouping
  grouping:true, 
  groupingView : { 
      groupField : ['cliDestination'],
      groupCollapse: true,
      groupSummary: true,
      groupSummaryPos: "header"
  }
}).jqGrid('navGrid','#pager-destinations', {
        edit: false,
        view: false,
        add: false,
        del: false
    }, 
    { }, // edit options
    { },// add options
    { },// del options
    { }, // search options 
    { } // view options
    ).jqGrid('setGridHeight', $("#page").height() - 175);
}
我正在按目标对数据进行分组。cliDestination是另一个具有ID和描述的对象,因此在表中,由于jsonmap属性,我看到了描述。 我希望数据也由cliDestination.destinationDesc排序

这将把参数sidx作为cliDestination asc、cliDestination和sord作为asc发送到服务器。 当我评论分组配置时,sidx是cliDestination和sordasc,这是应该的

知道这里发生了什么吗


谢谢你,我已经解决了。我意识到,当您分组并且数据是远程的时,jqGrid将sidx更改为groupByColumn sord,orderByColumn。 我必须在服务器中管理这些信息,才能从sidx orderByColumn中获取这些信息,并使用它们对数据进行排序