determine row id on SharePoint from javascript
Using Sharepoint DFWP, I have put a button on the form (ThumbsUp -- Like). When 开发者_开发百科a user clicks this button, it will add 1 to a Like's counter for the record. I will be using jquery to update the row...
My question is how do I get the rowID when I click the button.
Thanks in Advance!
In the handler:
var id = $(this).closest('tr')[0].id;
or
var id = $(this).closest('tr').attr('id');
or if by "id" you meant its index, do this:
var id = $(this).closest('tr')[0].rowIndex;
精彩评论