I have a Sharepoint 2013 list (html table) where I would like to get the row index if I click on a row element. After failing several times by using MouseEvent object I find a quite simple solution here.
So I am using a code like this:
$(document).ready(function()
{
$("tr").click(function (){
alert($("tr").index(this));
});
});
This is working well, but if I click on the button to go to the next 30 element of the table it stops working and even if I return to the first page not working anymore. So I have to reload the page to make it works again. What I noticed is that the page is the same, so it is not redirect to a new url, but it gets an addition to the url if I click on the button like: "#InplviewHashea3cdf07-1a28-4a44-bcb2-01f7d45a76c0=Paged%3DTRUE-p_ID%3D340-PageFirstRow%3D31". Sadly I am new to JS so I have no idea how to deal with this. Thanks you very much for any suggestion!