Author Topic: How can we display the summary in row grouping ?  (Read 3444 times)

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
How can we display the summary in row grouping ?
« on: August 09, 2017, 07:26:58 pm »
How can I display the summary on top instead of bottom of the row? I wanted to display summary similar to the attached images.


 or Is that possible to display the row grouping name with subtotal in summary?
 General Requirements Subtotal   or Initiation Subtotal

   

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: How can we display the summary in row grouping ?
« Reply #1 on: August 09, 2017, 09:57:45 pm »
Your screenshot is missing, but I guess we already discussed it in this post.

https://paramquery.com/forum/index.php?topic=2191

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
Re: How can we display the summary in row grouping ?
« Reply #2 on: August 09, 2017, 10:11:11 pm »
What changes I need to do to achieve my requirement this is very urgent ?for alternative approach can we display the groping Name in summary row at bottom - see the attached screenshot.


I may need to find out any other grid plugins if this is not working but I hope this features should be available. 

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: How can we display the summary in row grouping ?
« Reply #3 on: August 09, 2017, 11:16:41 pm »
I've updated this demo to display group titles in corresponding summary rows.

https://paramquery.com/pro/demos/group_rows_hidden

Hope it helps.

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
Re: How can we display the summary in row grouping ?
« Reply #4 on: August 10, 2017, 12:07:56 pm »
Thanks I have used the the below code

columnTemplate: {
                render: function(ui){
               var rd = ui.rowData,
                       level = rd.pq_level;
                    if(level != null){
                        //to display group titles in first visible cell of summary rows.
                  if(rd.pq_gsummary && this.getFirstVisibleCI() == ui.colIndx){
                     
                     var data = this.pageData(), i = ui.rowIndx, dis = this.option('groupModel.dataIndx');
                     while(i--){
                        rd = data;
                        if(rd.pq_level == level){                        
                           return {text: "<i>" + rd[ dis[ level ] ] + ":</i>", style: "text-align:right;"};
                        }
                     }
                     
                  }
                  else{
                            //to indent group titles.
                     return {style: "padding-left:"+(level*20)+"px;"};
                  }                       
                    }
                }
            },           


this.getFirstVisibleCI() == ui.colIndx condition always returning false not going in if condition

Where I am doing wrong Please suggest?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: How can we display the summary in row grouping ?
« Reply #5 on: August 10, 2017, 06:17:43 pm »
Could you please share a jsfiddle?

EPM Solutions

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 182
    • View Profile
Re: How can we display the summary in row grouping ?
« Reply #6 on: August 10, 2017, 07:05:26 pm »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: How can we display the summary in row grouping ?
« Reply #7 on: August 10, 2017, 09:41:10 pm »
your jsfiddle is incomplete, there is no output.

Please include the necessary scripts. this jsfiddle http://jsfiddle.net/0wgs1orb/ can be used to include js & css dependencies.

and remote data can be replaced by local data.