id attribute goes missing?
id attribute goes missing?
cmouse
Posts: 3Questions: 0Answers: 0
I am not sure whether this bug is in Firefox or data tables, but it would appear that any id attributes that tr elements have are removed in pagination. The first 10 elements retain their id or data-id attribute, but on next pages, the attributes appear removed on DOM's perspective. I could not get any IDs out with $("tr")[n].attributes or $("tr")[n].id. I am using jQuery-1.8, jquery-ui-1.9.0 and dataTables-1.9.4.
This discussion has been closed.
Replies
Allan
Because $('tr').on('click'... doesn't pass in the correct element, as I can't get the id or data-id out with e.target.parentNode.
Sometimes :-). You may want to use table.$().on for static events - but if you are using a live / delegated event, then probably not, and I would recommend the latter method.
Allan
[quote]As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live().[/quote]
Perhaps it's worth checking that it works with .on() as well?
Allan