PDA

View Full Version : Apply Read-Only to a CheckColumn



iNes14
10 Jan 2012, 2:20 AM
Hello !

I want to make, in a grid, a checkcolumn read-only/no editable. Can somebody help me ?

Thank you !

Farish
10 Jan 2012, 3:23 AM
You can use this for that column:


{ header: 'Something', dataIndex: 'something', width: 135, menuDisabled: true,
renderer: function(value) { // This function converts true and false into checkbox checked or unchecked
if(value == "0" || value == "false")
value = false;
else if(value == "1" || value == "true")
value = true;
return "<input type='checkbox' disabled='disabled'" + (value ? "checked='checked'" : "") + ">";
}
}

You can enable/disable the other configs like menuDisabled, sortable etc according to your needs.