jqgrid 编辑状态获取该单元格的元素的id 和操做该元素

function listData() { jQuery(grid_selector).jqGrid({ url: ctxPath + '/pfmcePlan/hrEffPfmcePlanee/achievementsTargetlistData.do?' + 'hrEffPfmcePlaneecptId=' + hrEffPfmcePlaneecptId, datatype: "json", mtype: 'POST', height: 500, //{name:'isShow',index:'is_show', width:50, sortable:false, formatter: isShowformatter}, colNames: ['主键', '类别', '工做目标', '描述', '权重(%)', '完成时间', '状态', '操做', '上级名称', '员工计划价值观id' ], colModel: [json

{ name: 'id', width: 100, hidden: true },
        // sortable: false 不能够排序,即点击不会出现排序图标选择的。 
        { name: 'type', width: 75, sortable: false, editable: true, edittype: "select", formatter: typeFmatter, editoptions: { value: "1:OKR;2:重点工做" } },
        //  editable: true 可编辑,即在单元格里面编辑。
        .....

}url

//编辑 function editRow() { var id = $(grid_selector).jqGrid('getGridParam', 'selrow');code

//全列可编辑的编辑 jQuery(grid_selector).jqGrid('editRow', id); //显示以前选好的selectorm

if (type) {
    //获取编辑的 select的 id 进行选择。
  //其余的单元格的 元素都是这样的,当前列的 id 加上 当前列的 name 值,就是该元素的id .
    $("#" + id + "_type").val(type + "");
}

}排序

相关文章
相关标签/搜索