As I know that mygrid.setColTypes can be used to set column’s editability.
However, is it possible to control particular cells’s editability ? is there any build-in API ?
Thanks a lot.
You can disable any cell by
grid.cells(id,ind).setDisabled(true); // make cell at specified position readonly
I used grid.cells(id,ind).setDisabled(true); to set cells in first row with 6 columns to become read only. However,the error message said "r1 is not defined"
How can I solve the problem? Is there any other method to set cells in one row read only.Thank a lot.
for(var ind=0;ind<6 ;ind++){
grid.cells(r1,ind).setDisabled(true);
}
<?xml version="1.0" encoding="UTF-8" ?>
AC
ACC
0.00
0.00
0.00
0.00
Probably the correct approach is
grid.cells(“r1”,ind).setDisabled(true);
as “r1” is not the variable.
Also this method should be called after xml loading:
grid.loadXML(url,doAfterLoading);
function doAfterLoading(){
for(var ind=0;ind<6 ;ind++){
grid.cells(“r1”,ind).setDisabled(true);
}
}
a) The xml loading is async, you need to call the js comman only after data loading ( onXLE event or second param of loadXML )
b) can be set directly from XML as
<cell type=“ro”>AC
<cell type=“ro”>ACC
<cell type=“ro”>0.00
<cell type=“ro”>0.00
<cell type=“ro”>0.00
<cell type=“ro”>0.00