A dhtmlxgrid has to be populated from an xml using mygrid.loadXMLString();, in the xml , how can we make the row type as read-only. For making the cell type as read-only , we use
'<cell align=‘left’ type=‘ro’ ’ in the xml for populating the grid. In a similar way what should be the command to make the entire row as read only.
The “type” attribute of a row isn’t processed automatically. However, there are getRowAttribute and setRowExcellType methods which can be used to set row type based on the row attribute:
<row id='1' type="ro">
grid.loadXML(url,function(){
grid.forEachRow(function(id){
var type = this.getRowAttribute(id,"type");
if(type)
this.setRowExcellType(id,type);
})
});
West
In JS 0 is the same as null. Therefore, it would be better if a row id were different from 0.
This technique works pretty good… however, I have cells in the row that are of type “co” and “ch”. When in “read only” mode, the “co” shows the option value (1, 2, 3, etc.) instead of the name of the field, and the “ch” shows a “1” or “0” depending on the state. Is there a way to make this show the data properly when in read only mode?
There is no automatic “lock-by-value” functionality.
Still, you can use event system of the component, and when specific value loaded or set by user, event handler can call lockRow API for row in question.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan