-
Notifications
You must be signed in to change notification settings - Fork 323
Disable editing on a cell. Only using javascript #18
base: master
Are you sure you want to change the base?
Conversation
added preventColumns
Thanks for this, helped me with my project! I made a couple changes on top of this: remove the line and add the following code immediately after the block that contained the removed line (so after the .
This change makes it so the cursor doesn't show as a pointer (the pointing hand) on disabled cells. |
thanks worked like a charm! :) |
hi looks like this version is not yet merged back to the master? could help to update? i want to use this feature as well. Thanks! |
Hi @ddykhoff could send me your latest script? Now is not really clear whether is it being locked or not, because you can double click the cells but could not change the value. Really appreciate your help! Thanks! |
I use the following syntax, please also add this to your next PR:
jQuery callback that I wrote:
|
I like @DRDDavidSoft's solution but its worth noting that this will still allow editing on double-click, all other things being equal. |
@alexfulsome This could be a potential fix for double-clicks: $('td[readonly]').dblclick(function(e) {
e.preventDefault();
e.stopPropagation();
}); ... or combining them: $('td[readonly]').on('click dblclick', function(e) {
e.preventDefault();
e.stopPropagation();
}); |
you still can press the control key to change the value
|
For example disabling edit of column two and three:
$('#table').editableTableWidget({ editor: $ (''), preventColumns: [ 2, 3 ] });