Author Topic: Can the total number of records not include subtotal record  (Read 2509 times)

datafor

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 3
    • View Profile
Can the total number of records not include subtotal record
« on: August 19, 2019, 08:56:58 am »
Hi
      Here is my problem:We use the remote paging. In each page there will be several detail records, and several subtotal records which are also calculated by the server side. Can the total records not count subtotal records?
      Thanks!

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6298
    • View Profile
Re: Can the total number of records not include subtotal record
« Reply #1 on: August 19, 2019, 09:48:32 pm »
Total records count all kind of rows except in fixed rows at bottom, it can't be prevented.

datafor

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Can the total number of records not include subtotal record
« Reply #2 on: August 20, 2019, 03:39:57 pm »
Thanks for your reply.
So, is it possible to keep the totals records from counting some of the specified rows in every page? Setting configurations or calling pqGrid api, or extending pqGrid by adding custom scripts, or otherwise?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6298
    • View Profile
Re: Can the total number of records not include subtotal record
« Reply #3 on: August 21, 2019, 08:47:17 am »
Any rows in summaryData option are not counted in total rows in grid.

https://paramquery.com/pro/api#option-summaryData

Example of usage of summaryData: https://paramquery.com/pro/demos/summary_json

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6298
    • View Profile
Re: Can the total number of records not include subtotal record
« Reply #4 on: August 23, 2019, 08:54:14 am »
This workaround can be used

Add extra rows in dataReady event.

Code: [Select]
dataReady: function(evt, ui){
        //add any extra rows here by array manipulation of pageData.
this.pageData().unshift({});
},


Please note that being a workaround it may or may not work properly in upcoming versions.