开发者

determine row id on SharePoint from javascript

开发者 https://www.devze.com 2023-02-10 05:19 出处:网络
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 upd

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;
0

精彩评论

暂无评论...
验证码 换一张
取 消