How to prevent inline editing on a column
How to prevent inline editing on a column
I want to prevent inline editing on a column so I define a class of no_edit
on that column thinking I can do something like this:
$('#my_table').on( 'click', 'tbody td:not(:first-child)', function (e) {
if (the class of this is not no_edit) editor.inline(this);
});
Problem is how do I do the class of this is not no_edit
? Any suggestions would be appreciated.
ngungo
This question has accepted answers - jump to:
This discussion has been closed.
Answers
you're already using jquery so a quick googling led me to this:
if(!$(e.target).hasClass('no_edit){
editor.inline(this);
}
if that's not bang on, just fiddle with it in a debugger or ask on jquery/js forums maybe
It's brilliant. :)
Thanks!
I think it can be simplified - just use a selector of
td:not(.no_edit)
? See also this example.Allan
Thank you, Allan!