开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜