Disable editing of one cell based on its content
Disable editing of one cell based on its content
eclipsetalk
Posts: 10Questions: 3Answers: 0
Hello,
I'm enable column 6 for editing as follow:
"fnDrawCallback" : function() {
tableGrid.$('td:eq(6)').editable(function(value, settings) {
var td = $('td#' + this.id);
displayStuff(td, this.id, value);
}, {
type : 'text',
cssclass : 'textInline',
name : 'textInline',
submit : 'Ok',
cancel : 'Cancel'
});
},
I'd like to disable the editing for the cells for which the html content is a given value. How can I do that?
Thanks in advance for any pointers.
This discussion has been closed.
Answers
You'd need to either modify the selector you are using to check if there is content for whatever value, or refer to whatever plug-in it is that you are using for the
editable()
action (xEditable?) and see if it has an even that you can cancel.Allan
Thanks for the reply.
I'm using dataTable and jquery.jeditable.mini.js for the editable().
I tried to get the click event as follow. However I get the event on all the cells except the one that is editable.
Could you please expand on how to go about modifying the selector?
Thanks
That might mean that jEditable is doing some kind of stopPropagation itself. I haven't used jEditable in years I'm afraid so I don't know the ins and outs of it. You'd probably need to ask the developer of that software, with a link to a page showing the issue.
It would also be worth trying it without DataTables so see if that is what is causing the issue.
Allan
Thanks I'll keep digging around.