From 347c342a7a01985c6b6cd80a240218cf232d969b Mon Sep 17 00:00:00 2001 From: Tomer Simis Date: Thu, 21 Aug 2014 01:41:19 -0300 Subject: [PATCH 1/2] Included disable class option to ignore the editing of certain table cells --- mindmup-editabletable.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mindmup-editabletable.js b/mindmup-editabletable.js index 36be540..3a679ff 100644 --- a/mindmup-editabletable.js +++ b/mindmup-editabletable.js @@ -14,7 +14,7 @@ $.fn.editableTableWidget = function (options) { active, showEditor = function (select) { active = element.find('td:focus'); - if (active.length) { + if (active.length && !active.hasClass(activeOptions.disableClass)) { editor.val(active.text()) .removeClass('error') .show() @@ -126,6 +126,7 @@ $.fn.editableTableWidget.defaultOptions = { cloneProperties: ['padding', 'padding-top', 'padding-bottom', 'padding-left', 'padding-right', 'text-align', 'font', 'font-size', 'font-family', 'font-weight', 'border', 'border-top', 'border-bottom', 'border-left', 'border-right'], + disableClass: 'edit-disabled', editor: $('') }; From b0e39a1e143aebfb9e68eab691a26e7ccacb8024 Mon Sep 17 00:00:00 2001 From: Tomer Simis Date: Thu, 21 Aug 2014 01:44:57 -0300 Subject: [PATCH 2/2] Updated with disable cell feature --- index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 83acae5..bc87d2c 100644 --- a/index.html +++ b/index.html @@ -40,7 +40,7 @@

editableTableWidget
tiny editable jQuery Bootstrap spreadsheetBike3302401 Plane4305403 Yacht1002000 - Segway3302401 + Segway <- Editing disabled3302401 TOTAL @@ -97,6 +97,11 @@

Usage

return false; // reject change } }); + + +

Disable editing on some cells by adding a class to them

+
+$('#table').editableTableWidget({disableClass: "edit-disabled"});