How To Dynamically Add "More" Option To Rows
How To Dynamically Add "More" Option To Rows
MikeS
Posts: 113Questions: 1Answers: 0
I came across this post http://datatables.net/forums/discussion/17590/adding-a-button-per-each-row-with-mouseover-event-adding-click-event-on-button/p1 while trying to put a "More..." button on the row that would reveal more detail about the row. As with the OP, I can't determine when the option is clicked!
Currently, I'm able to double click the row to toggle the details for the row, but, I'd prefer to have a visual clue like "More..." to trigger this action.
The issue got closed and I can't find any way to resolve it.
I'll update this post with a jsFiddle once I can produce the issue. Just thought that if the solution is a simple one, perhaps the jsFiddle isn't even required.
Currently, I'm able to double click the row to toggle the details for the row, but, I'd prefer to have a visual clue like "More..." to trigger this action.
The issue got closed and I can't find any way to resolve it.
I'll update this post with a jsFiddle once I can produce the issue. Just thought that if the solution is a simple one, perhaps the jsFiddle isn't even required.
This discussion has been closed.
Replies
Move mouse pointer over rows and try to click the button. No alert is given.
The problem with `mouseover` is that it fires every time you mouse over a child element of the target as well (cells, and the button in this case) which disrupts things badly. Its also a performance hit. `mouseenter` (and `mouseleave` ) are much nicer.
Allan
UPDATE: The alert sometimes appears but it seems random when it does. I don't have any sequence of events to give. All that I could determine is that if I keep clicking the button or the actual row and then try different rows, eventually sometimes the alert is shown.
I would say that your code is making the HTML invalid since it is adding a button to a `tr` element. Perhaps that effects some browsers...
Allan
Thanks again for your help.