Add Id dynamically in a row

Good Morning!
Is it possible to add an Id in the pivotGrid rows, using some syncfusion method or event?
Example:

<td class="value" data-p="7,3" colspan="1" rowspan="1" role="gridcell"><span class="cellValue" aria-label="row- 2017-09-16T13:00:00.000Z: column- Entrada - ETE-Condutividade" "  data-id=”419”>50.0 µhoms</span></td>

<td class="value" data-p="8,3" colspan="1" rowspan="1" role="gridcell"><span class="cellValue" aria-label="row- 2017-09-16T13:00:00.000Z: column- Entrada - ETE-DBO" "  data-id=”420”>666.0 mg/L</span></td>


I would also like to know if I can edit the rows at the time of their creation, added the id or change the color of a particular column dynamically?

1 Reply

RG Ramesh Govindaraj Syncfusion Team January 16, 2018 10:53 AM UTC

Hi Anderson, 

Thank you for using Syncfusion products. 

Currently we don’t have support for adding HTML attributes dynamically while creating table element. But the requested scenario can be achieved through work around with the help of “renderSuccess” event.   
 
Code Snippet[html]: 
$("#PivotGrid1").ejPivotGrid({         //...         renderSuccess: function (args) {          var colIndex= 1;        var selectedCells=$(".e-pivotgrid table tr").find("[data-p^='" + colIndex + "']");                                                                for(var i=0;i<selectedCells.length;i++){          $(selectedCells[i]).attr("data-id",i);           $(selectedCells[i]).css("background-color","grey");         }          }});
 
Please find the sample in the below link: 
 
Please let us know, if you have any queries. 
 
Regards, 
Tamilarasu M. 


Loader.
Up arrow icon