Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Daniel on Feb 29, 2008 17:51
open dhtmlx forum
How can I define a grid column that is of type 'price' and is readonly at the same time?

Hi,

I think there is a misunderstanding about the nature of column types when it comes to particular column type called readonly (ro).

Readonly is a behavioral attribute of a column and shouldn't be mixed with other data types types like string, price, tree,date, numerical ...etc.

So again, how can we have a column of particular type and is readonly at the same time?

Thanks,
Answer posted by Support on Mar 03, 2008 06:53
a) It can be done by creating new excell type.

b) it can be done by using ron column with formatting
    grid.setColTypes("ron");
    grid.setNumberFormat(0,"$0,000");

c) It can be done by custom event

    grid.attachEvent("onEditCell",function(id,ind){
       if (ind == INDEX ) return false;
       return true;
    })


where INDEX - index of column which need to be switched to readonly.


>>Readonly is a behavioral attribute of a column and shouldn't be mixed
Basically it is correct, but in current design excell control all aspects of data editing|rendering, and we can't just jump to new approach because of backward compatibility issues.