Author Topic: Calculative Column and Reference Of Calculative Column in Next Row  (Read 632 times)

vijay@spinetechnologies

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 87
    • View Profile
Hi Team,
In PQ Grid can we achieve Calculative Column and Reference Of Calculative Column in Next Row?
Please find the attachment for your reference.







paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Calculative Column and Reference Of Calculative Column in Next Row
« Reply #1 on: August 10, 2022, 10:21:21 pm »
you can either use Excel formulas or cell value getters with rowTemplate option.

vijay@spinetechnologies

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 87
    • View Profile
Re: Calculative Column and Reference Of Calculative Column in Next Row
« Reply #2 on: August 11, 2022, 12:22:15 pm »
How to access previous or next rows in RowTemplate ?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Calculative Column and Reference Of Calculative Column in Next Row
« Reply #3 on: August 12, 2022, 11:32:41 am »
"this" points to current rowData inside getter/setter of rowTemplate

so previous row is

Code: [Select]
var nextRow = grid.pageData()[this.pq_ri - 1];

where grid points to grid instance ( a global variable ) and is obtained in render event.

Code: [Select]
render: function(){
grid = this;
},