Author Topic: Is there a way to change the unit of the pager?  (Read 2125 times)

eloan

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 25
    • View Profile
Is there a way to change the unit of the pager?
« on: October 26, 2016, 01:46:47 pm »
Hi.

I'd like to operate by the user viewpoint.
Are there any good ways?

I'd like to show 2-6 line of pqGrid as 1 line.
But pager can control only by the row unit.

For example when 2 lines are 1 line(unit).

=== sample code. =================================================
$(function () {
    var obj = { width: 600, height: 300, showTitle: false, numberCell: {"show" : false} };
    obj.colModel = [ { title:"id",    dataIndx:"id", hidden: true }
                ,{ title:"Test" , dataIndx:"a" }
                ,{ title:"type", dataIndx:"type" }
                ,{ title:"Sum", dataIndx:"sum" }
                ,{ title:"data1", dataIndx:"data1" }
                ,{ title:"data2", dataIndx:"data2" }];
    obj.freezeCols = 4;
    obj.dataModel = { data: [{ "id":"1" , "a":"test1", "type":"A", "sum":"6", "data1":"1", "data2":"5" }
                   ,    { "id":"2" , "a":"test1", "type":"B", "sum":"6", "data1":"1", "data2":"5" }
                   ,    { "id":"3" , "a":"test2", "type":"A", "sum":"6", "data1":"1", "data2":"5" }
                   ,    { "id":"4" , "a":"test2", "type":"B", "sum":"6", "data1":"1", "data2":"5" }
                   ,    { "id":"5" , "a":"test3", "type":"A", "sum":"6", "data1":"1", "data2":"5" }
                   ,    { "id":"6" , "a":"test3", "type":"B", "sum":"6", "data1":"1", "data2":"5" }
                   ,    { "id":"7" , "a":"test4", "type":"A", "sum":"6", "data1":"1", "data2":"5" }
                   ,    { "id":"8" , "a":"test4", "type":"B", "sum":"6", "data1":"1", "data2":"5" }
               ]};
   obj.pageModel = { type:"local", rPP:"4", rPPOptions: [ "2", "4", "8" ]};
    var $grid = $("#grid").pqGrid(obj);
   var mergeAry = [{r1: 0, c1: 1, rc:2, cc:1},{r1: 2, c1: 1, rc:2, cc:1},{r1: 4, c1: 1, rc:2, cc:1},{r1: 6, c1: 1, rc:2, cc:1}];
   $grid.pqGrid({mergeCells: mergeAry});
   $grid.pqGrid("refreshView");
});
</script>
<body><div id="grid" style="margin:auto;"></div></body>
=================================================================

actual condition.
  Data is acquired by remote.
  In a load event.
    Marge cell is controlled by javascript
    The way to rewrite a variable of a pager soon in a load event.

I'd like to show records more to rPP in that case.

Best regards.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Is there a way to change the unit of the pager?
« Reply #1 on: October 26, 2016, 09:20:06 pm »
I'm afraid to say pager counts the rows by individual units and there seems no way to customize it.
« Last Edit: October 26, 2016, 09:30:44 pm by paramquery »

eloan

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Is there a way to change the unit of the pager?
« Reply #2 on: October 27, 2016, 05:47:31 am »
OK.
It was understood that there are no ways.
thanks.