easyui datagrid 获取行号

$.extend($.fn.datagrid.methods, { 
         getRowNum:function(jq){ 
             var opts=$.data(jq[0],"datagrid").options; 
             var array = new Array(); 
             opts.finder.getTr(jq[0],"","selected",1).each(function(){ 
                 array.push($(this).find("td.datagrid-td-rownumber").text()); 
             }); 
             return array.join(","); 
         } 
});

 

 

调用方法:

$('#tt').datagrid('getRowNum')

 

 

本文转自http://cheen.iteye.com/blog/1889238

你可能感兴趣的:(js)