diff --git a/README.md b/README.md index 0ceb596..0d542f8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ + + editable-table ================= @@ -20,6 +22,16 @@ Basic Usage See http://mindmup.github.com/editable-table/ +Extended Features +----------- + +1. Added the possibility to prevent edit of certain columns. Maybe you have a remove link or something that should be handled differently. For example if second and third column not should be editable, you simply initializes the table as: +```example + $('#table').editableTableWidget({ editor: $(''), preventColumns: [ 2, 3 ] }); +``` + +Thanks Gojko Adzic for a nice and light weighted library! + Dependencies ------------ * jQuery http://jquery.com/ diff --git a/mindmup-editabletable.js b/mindmup-editabletable.js index 36be540..d9abcfe 100644 --- a/mindmup-editabletable.js +++ b/mindmup-editabletable.js @@ -15,6 +15,13 @@ $.fn.editableTableWidget = function (options) { showEditor = function (select) { active = element.find('td:focus'); if (active.length) { + + // Prevent edit of the columns specified + if ($.inArray(active.index() + 1, activeOptions.preventColumns) != -1) { + active.blur(); + return; + } + editor.val(active.text()) .removeClass('error') .show()