how to change css on an inline edit
how to change css on an inline edit
 hbanaharis            
            
                Posts: 32Questions: 14Answers: 3
hbanaharis            
            
                Posts: 32Questions: 14Answers: 3            
            Hi I've assigned a class to a column as follows:
{ className: "myclass", "targets": [ 6 ] },
What is the appropriate way to have this command executed following an inline edit:
$('.myclass').filter(function(index){
return parseInt(this.innerHTML) < 20;
}).css({'color':'red', 'text-decoration':'underline'});
This question has an accepted answers - jump to answer
This discussion has been closed.
            
Answers
The
rowCallbackoption is the way to do this at the moment. There isn't currently anupdateevent that is triggered by DataTables.Another option might be to use
postEditwhich would be more efficient processing-wise, but it wouldn't set the style for the initial display.Allan
Thank you for your prompt reply. I've implemented your suggestion and it works. A further question: how would one implement the CSS only on the row that was edited?
The logic applied by the
rowCallbackwill always be applied to the rows that are drawn in the table - all rows. Only usingpostEditcould you modify only that one row.Allan