jqgrid 行编辑/单元格selsect 下拉框并运用select2


{name:"untivalue", index:"untivalue",hidden:true,width:0,classes:'untivalue'},

{name:"itemname", index:"itemname", width:100,align:"center",editable: true,edittype:"select", editoptions:{value:  

  function(url){
    var html = ':;';
     ajax.get(url, function(data){

      for(i=0;i<data.length;i++){
        if(i != data.length - 1){
          html += data[i].value + ":" + data[i].name + ";";
        }else{
          html += data[i].value + ":" + data[i].name;
        }

      }

    })
    return html;
   }

, dataEvents:

      function(classes){
        var obj = [
          {
          type: 'change',
          fn: function(e) {
          var $this = this;
          

      function ($this,classes){
        var val = $this.value;
        $($this).closest('td').siblings('td.'+classes+'').html(val).attr('title',val)
      },


          }
          }
         ]
      return obj;
     },

}},

  

//单元格编辑

afterEditCell: function (rowId, cellname, value, iRow, iCol) {   

       bkcsubtable.afterEditCell_select() //应用select2样式

}

//行编辑

onSelectRow : function(rowId,status) {

  jQuery(RecordGrid).jqGrid('editRow', rowId, true); 

  if(status){
    bkcsubtable.afterEditCell_select() ; //应用select2样式
  }

}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM