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 + "");
}

}排序

相關文章
相關標籤/搜索