我有一个网格,当我单击刷新按钮时,它什么也不做。没有向服务器发出请求。但我可以看到它执行 beforeRequest() 函数。有谁知道发生了什么?
jQuery("#paramlistFlex").jqGrid({
url: root + mod + '/setlistview',
datatype: "local",
colNames:[' ', 'Name of Set', 'Description of Set', 'Date of Set'],
colModel:[
{name:'myac', width:50, fixed:true, sortable:false, resize:false, formatter:'actions', formatoptions:{keys:true, editbutton : false, delbutton : false, delOptions: {reloadAfterSubmit:false},editOptions: {reloadAfterSubmit:false}}},
{name:'set_name',index:'set_name', width:200},
{name:'set_desc',index:'set_desc', width:400},
{name:'set_date',index:'set_date', width:200}
],
width: $('.body').width()-25,
height: ($('.body').height()-240)/2,
pager: '#pagerFlex2',
sortname: 'set_id',
sortorder: "desc",
editurl: root + mod + '/detailpost',
caption:"Set of Parameter List",
onSelectRow: function(id){
activedf = "#paramlistFlex";
},
afterInsertRow: function () {
var grid = $(this),
iCol = getColumnIndexByName(grid,'myac'); // 'act' - name of the actions column
grid.find(">tbody>tr.jqgrow>td:nth-child(" + (iCol + 1) + ")")
.each(function() {
if ($(this).find(">div>div").length == 2)
{
$("<div>",
{
title: "Delete",
mouseover: function() {
$(this).addClass('ui-state-hover');
},
mouseout: function() {
$(this).removeClass('ui-state-hover');
},
click: function(e) {
df_delete_1($(e.target).closest("tr.jqgrow").attr("id"));
}
}
).css({float:"left"})
.addClass("ui-pg-div ui-inline-edit")
.append('<span class="ui-icon ui-icon-trash"></span>')
.prependTo($(this).children("div"));
}
});
},
beforeRequest: function() {
var setid = $('input[name=item]').val();
if (setid == "")
setid = 0;
jQuery("#paramlistFlex").jqGrid('setGridParam',{postData:{setid: setid}});
console.log('hiya');
}
});
jQuery("#paramlistFlex").jqGrid('navGrid','#pagerFlex2',{add:false,edit:false,del:false,search:false});
jQuery("#paramlistFlex").jqGrid('gridResize', {minWidth:350, maxWidth:1920, minHeight:80, maxHeight:1080} );