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
795 stars 272 forks source link

Cell block #3

Closed neodani closed 13 years ago

neodani commented 13 years ago

I wonder if the current version can lock the cells so that can not be edited.

In the readme I have not seen anything about it.

Thank you very much!

webismymind commented 13 years ago

This is possible, although not (yet!) explained in the documentation.

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

myEditableGrid.isEditable = function(rowIndex, columnIndex) {
    // do whatever you want here
    return true;
};

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

But you can also make an entire column read-only: