Add class to field on editor open event
Add class to field on editor open event
Yani
Posts: 24Questions: 7Answers: 0
I am trying to add a class to a field with a simple editor 'open' handler:
editor.on('open', function(e, mode, action) {
if (mode == 'inline' && action == 'edit') {
$(this).addClass('no-padding');
}
});
However, I am unable to select the td element to add the class. How would I do this? Thanks.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I have found a solution for this. I don't think it's the best way but it works:
Now for some reason, the modifier changed from the td element to an object:
is there a consistent way to grab the td? I'd be very thankful if somebody could help me out here.
I'm still struggling with this.
Sadly, the modifier is inconsistent and I've not found anything else.
I'm sure this use case would be common?
I'd suggest using:
That will select the Editor container element for the inline edit, which is inside the cell (when inline editing) and then get the container cell.
Regards,
Allan
Thanks Allan. That's exactly what I was looking for.
How come there is no documented functionality for this?