如何在单击时获取Jquery Grid整个行的值 [英] How to get the Jquery Grid entire row values on click
本文介绍了如何在单击时获取Jquery Grid整个行的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我单击jquery网格行时,我需要获取整个行的值.这是我正在使用的代码
I need to Get the Entire Row values when I click on jquery grid row.. here is the code I am using for that
var RowClick = function(e) {
var resultArray = $("#Grid td:first:child").closest('tr').find('td').map(function() {
alert(resultArray);
});
};
对于此RowClick,我是在jQuery网格的Grid属性服务器端定义的
For this RowClick I defined in Grid property server side for the jquery grid
grid.ClientSideEvents.RowSelect = "RowClick";
有人可以告诉我单击行时我需要获取整个值还是第4和第5列的值吗?
Can any one tell me on click on Row I need to get entire values or 4th and 5th columns values?
谢谢
推荐答案
您是否使用过jQuery关键字.each?
Have you looked into using the jQuery keyword .each?
<script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
$('.Grid').click(function() { $(this).find('td').each( function() { alert($(this).html()); }) })
});
</script>
<table>
<tr class="Grid">
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
</tr>
</table>
这篇关于如何在单击时获取Jquery Grid整个行的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文