jqGrid获取表数据

   //获取Grid所选行的ID
		var GridId=$(grid_selector).jqGrid('getGridParam','selrow');
	    //通过GridId获得所选行数据
		var selectRow = $(grid_selector).jqGrid('getRowData',GridId);
		//console.log(selectRow.id);
	    //console.log(selectRow['id']);
	    var id = selectRow.id; 

jqGrid中文api


 jqGrid自带多选,实现单选的方法;

以下三个属性缺一不可:

[html] view plain copy

    multiselect: true,  
    multiboxonly:true,  
    beforeSelectRow: beforeSelectRow,//js方法  


[html] view plain copy

    function beforeSelectRow()  
        {  
            $("#jqgridId").jqGrid('resetSelection');  
            return(true);  
        }


猜你喜欢

转载自blog.csdn.net/jinseaa/article/details/78666354
今日推荐