easyui 查询条件form 数据遍历

       columns:[[
     {field:'ck',checkbox:true,id:'ck'},
     {field:'id',hidden:true,title:'id'},
     {field:'action',title:'操作',align:'center',formatter:formatAction},
           {field:'packetnum',title:'红包编码'},
           {field:'isdisable',title:'启用状态',formatter:formatEnable},
           {field:'remark',title:'备注',align:'center'},
           {field:'rulename',title:'来源',align:'center',formatter:formatRuelName},
         {field:'createdate',title:'生成时间'},
        {field:'startdate',title:'生效时间'},
          {field:'enddate',title:'失效时间'},
          {field:'isused',title:'使用状态',align:'center',formatter:formatUsed},
          {field:'smokeid',title:'领取状态',align:'center',formatter:formatsmokeid},
           {field:'usingdate',title:'使用时间'},
           {field:'usingusername',title:'使用人'}
       ]],
       onBeforeLoad: function(param){//queryForm' form id
   第一种方案:   

 $($('#queryForm').serializeArray()).each(function(){ 
         param[this.name]=this.value; 
              });

   第二种方案:

    queryParams : getFormJson($("#fm_s")[0]),


    },
    onBeforeSelect:function(){
     return false;
    }

 

 function getFormJson(form) {
  var o = {};
  var a = $(form).serializeArray();
  $.each(a, function() {
   if (o[this.name] !== undefined) {
    if (!o[this.name].push) {
     o[this.name] = [ o[this.name] ];
    }
    o[this.name].push(this.value || '');
   } else {
    o[this.name] = this.value || '';
   }
  });
  return o;
 }

 

转载于:https://www.cnblogs.com/cuijinlong/p/6681789.html

你可能感兴趣的:(easyui 查询条件form 数据遍历)