Editor: Are postEdit/postCreate events able to get the table row related to the edit?
Editor: Are postEdit/postCreate events able to get the table row related to the edit?
bworsfold
Posts: 14Questions: 4Answers: 0
I am hoping to be able to find the table row that was edited and change the style class for the row to show that it has been edited. Is this possible through these events? So far, it looks like "this" in the event is just a reference to the editor. I know that I can see the data being edited, but I am after the actual table row (tr) element.
This discussion has been closed.
Answers
So, I have a kludge where I go through each row in the table and then compare it's id with the data.id. I am not so happy with this approach, so if there are any more direct options, that would be great.
You can use the
modifier()
method to get the item thatedit()
was called with. This will likely be a row index, or row node, which you can then use with therow().node()
method to get thetr
element in question.Regards,
Allan
That would be sweet! I will give it a try today. Thanks Allan.
So, this works fine. Thanks so much for the pointer Allan. Very powerful option! This actually is a real nice addition so that users can see what has been modified in the table.
The Editor CSS should actually animate a flash of the table row that has been edited, like it does in this example. Does that not work for you?
It does use CSS animation, so it wouldn't work in older browsers.
Regards,
Allan
Not really. They want to be able to see the fact they row has changed permanently, that is until they refresh the page. They actually have a two step process. You do your edits on the data, then either commit the changes or roll them back. So, they want to be able to see the edits prior to committing the changes.
It is a bit old school, but something they want.
:)
Have a great day Allan.
Brad
Got it - thanks for the clarification. Your method is ideal then :-).
Allan