jqgrid下拉列表onclick of icon

jqgrid dropdown list onclick of icon

我正在尝试在 jqgrid 的一个单元格中显示下拉列表一个铅笔图标的 onClick(当单击整行时变得可编辑并且下拉列表显示在借方贷方中) 下图显示了我尝试做的事情

我的方法在代码下面是我所做的

''''''''''''''''''''''''gridfucntion''''''''''''''''''''''''''''''''''''''''

function showMinorityEntryData(){
    alert('minoritydatashow');
    if($("#reportingPeriodId").val()!="" && $("#parentCmp").val()!=""){
        alert('minoritydatashow1111');
    //  $('#masterDiv').show();
         $("#grid").jqGrid({
          datatype: 'json',
          url:'showMinorityData.action?companyId='+companyId+"&parentCmp="+$("#parentCmp").val()+"&reportingPeriodId="+$("#reportingPeriodId").val(),
          mtype: 'GET',
             colNames:['Id', 'GlELEMENTNAME', 'Account Type','Pre-Acq-Amount','Share Amount','Actions'],
             colModel:[
              {name:'id',index:'id', width:55,editable:false,editoptions:{readonly:true,size:10},hidden:false,jsonmap:"minorityId"},
              {name:'glElementName',index:'glElementName', width:100,editable:false, editrules:{required:true}, editoptions:{size:10},jsonmap:"glElementName"},
              {name:'accountType',index:'accountType', width:100,editable:true, editrules:{required:true}, edittype:"select",formatter:'select',editoptions:{ value:  "Debit:Debit;Credit:Credit"},editoptions:{size:10},jsonmap:"acntTypeName"},
              {name:'preAcqAmount',index:'preAcqAmount', width:100,editable:true, editrules:{required:true}, editoptions:{size:10},jsonmap:"preAcqAmt"},
              {name:'shareAmount',index:'shareAmount', width:100,editable:true, editrules:{required:true}, editoptions:{size:10},jsonmap:"shareAmt"},
              {name:'actions',index:'actions', sortable:false,width : 50,align : 'center',formatter:actionIcons}
             ],
             
             postData: {
          },
             rowNum:20,
             rowList:[10,20,40],
             height: 200,
             autowidth: true,
         //    rownumbers: true,
             pager: '#pager',
             sortname: 'minorityId',
             viewrecords: true,
             sortorder: "asc",
             caption:"Minority Interest",
             emptyrecords: "Empty records",
             loadonce: false,
             loadComplete: function() {
          },
             jsonReader : {
                 root: "rows",
                 page: "page",
                 total: "total",
                 records: "records",
                 repeatitems: false,
                 cell: "cell",
                 id: "minorityId"
             },
             editurl: 'clientArray',
         });    
    }
}

我从这个得到帮助linkhttp://www.codeproject.com/Articles/610359/JqGrid-Inline-Editing

但是当我在下拉列表中转换 accountType 单元格时,它不显示帐户类型,下图显示了发生的情况

当我点击铅笔图标时,整行变为可编辑,但在帐户列中,下拉列表不显示任何值

我做错了什么。 jqgrid 对我来说是新的

提前致谢

在代码中你必须这样写 {name:'accountType',index:'accountType',width:100,editable:true,editrules:{required:true},editoptions:{size:10},edittype:"select" ,formatter:'select',editoptions:{ 值:"Debit:Debit;Credit:Credit"},jsonmap:"acntTypeName"}, 这将解决我的要求

您应该包含 editoptions 或任何其他 属性 一次 。所以

editoptions:{ value:  "Debit:Debit;Credit:Credit"},editoptions:{size:10}

需要替换为

editoptions: { value: "Debit:Debit;Credit:Credit", size:10}