Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by TJ on Aug 01, 2008 06:52
open dhtmlx forum
Display format for Math type cell


Thank you for solution to my earlier question.

I have one column defined as "ron[=]" with setNumberFormat as "$0,000.00" and it works just fine. I have also defined custom eXcell "percent" which displays numbers in percentage format, i.e. for "35" it will display 35%. This is also working fine.

Now, I am in a situation where I need to display "percent" type of data iin "ron[=]" column data. And the "percent" is calculated. So for that cell my xml code is like this:

<cell type="math">=c8*[[5c,9]]/100</cell>

It needs to be of type "math" and thus it displays "$35.00" and I want this to be displayed as "35%". Is it possible to achieve this anyway?

Please let me know.

Thanks.

TJ
Answer posted by Support on Aug 01, 2008 07:39

The results of math may use only per column formatting settings, there is no way to have two different formatting types for results of math operation in same column.

If you know exact position of cell you can resolve problem by adding something similar to next

grid.attachEvent("onCellChanged",function(id,ind){
  if (id == ID && index == INDEX ){
      var cell = mygrid.cells(id,ind);
      var val=cell.getValue();
      cell.cell.innerHTML=val+"%";
  }
});