Hi,
I have a column in a grid having both positive and negative numbers.The bottom of the grid contains a footer with total’s for each column.I would like to know if I can replace any negative number within a bracket just like -1234 becomes (1234) with the colour of the value appearing in red.
However any custom styling would affect the totaling as we have used the #stat_total to perform a summation.Changing it to (1234) should not affect the totaling.
Regards,
Vikram
if I can replace any negative number within a bracket
It possible to use onCellChanged or onRowCreated event to dynamically change the data of cell
grid.attachEvent(“onCellChanged”,functon(id,ind,value){
if (ind == INDEX && value*1 < 0 ){
this.cells(id,ind).cell.innerHTML="("+value+")";
this.cells(id,ind).cell.style.color=“red”;
}
})
>>However any custom styling would affect the totaling as we have used the #stat_total
Adding red color in above way, will not affect totaling, but adding “(” “)” will break summation logic ( because value will not be identified as valid number anymore )
The more complex solution, which will work correctly for both rendering and summation can be done through custom excells - in such case you will be able to define custom rendering rules and maintain valid numeric representation in the same time.
dhtmlx.com/docs/products/dhtmlxG … #grid_cexc
I works well, but we have a problem. When I enable smart rendering only the first set of rendered rows have the custom style. How do we handle the styling for the other rows.
Are you sure that xml contains “style” attribute for all rows ?
Please, provide some details: how do you set style? and what grid version do you use ?