webismymind / editablegrid

EditableGrid is an open source Javascript library aimed at turning HTML tables into advanced editable components. It focuses on simplicity: only a few lines of code are required to get your first table up and running.
http://www.editablegrid.net
Other
796 stars 271 forks source link

Mark column as ineditable #50

Closed SunnyMittal closed 10 years ago

SunnyMittal commented 10 years ago

Hi, is it possible to mark a column non-editable in editable grid ? I have a requirement where the first column will have static information and that should not be allowed to change. Thanks! Sunny

webismymind commented 10 years ago

Hello,

You can set the "editable" attribute to "false" in each column declared in the JSON or XML data.

Alternatively, you can declare a callback method named "isEditable", for example:

myEditableGrid.isEditable = function(rowIndex, columnIndex) {

// make first column readonly
return columnIndex > 0;

};

This allows dynamically deciding if a cell should be editable or not, and it's the most general solution.

Regards, Louis

2014-07-10 23:38 GMT+02:00 SunnyMittal notifications@github.com:

Hi, is it possible to mark a column non-editable in editable grid ? I have a requirement where the first column will have static information and that should not be allowed to change. Thanks! Sunny

— Reply to this email directly or view it on GitHub https://github.com/webismymind/editablegrid/issues/50.

SunnyMittal commented 10 years ago

Thanks a lot Louis !