jqGrid增加toolbar


id="grid-table-toolbar" class="container-fluid">
class="form-inline" οnsubmit="return false;">
class="row">
class="form-group col-md-3"> type="text" class="form-control" name="id" id="id" placeholder="客户类型" style="width: 180px;">
class="form-group col-md-3"> 黑名单:
class="form-group col-md-3"> 时间: type="text" id="toolbar-datepicker" name="createDate" class="form-control" style="width: 180px;"/>
class="col-md-1">
class="col-md-1" style="margin-left: 20px">
 
  
 
  
$("#toolbar-search").click(function () {
    
var postData = $(grid_selector).jqGrid("getGridParam", "postData");//获取postData数据

$.each(postData, function (k, v) {//将上次postData的数据清空
    if (k == "id" || k == "isBlack" || k == "createDate")
        delete postData[k];
});

var id = $("#grid-table-toolbar [name='id']").val();
var isBlack = $("#grid-table-toolbar [name='isBlack']").val();
var createDate = $("#grid-table-toolbar [name='createDate']").val();

postData.id = id;//将数据添加到postData中
postData.isBlack = isBlack;
postData.createDate = createDate;
//设置数据,并重新加载
$(grid_selector).jqGrid("setGridParam", {postData: postData}).trigger("reloadGrid");
}) ;


 
  
toolbar: [true, "top"] 
 
  

你可能感兴趣的:(jqGrid增加toolbar)