Jqgrid add后添加数据的层没自动关闭,里面填入的数据也没清空,属性写了不起作用,请大神看看。
代码如下:
jQuery("#table_list_2").jqGrid('navGrid', '#pager_list_2',
{ add: true, del: true, search: false, refresh: true, edittext: "编辑", addtext: "添加", deltext: "删除"},
{
//edit
closeOnEscape: true,//Closes the popup on pressing escape key
reloadAfterSubmit: true,
drag: true,
afterSubmit: function (response, postdata) {
alert(response.responseText);
if (response.responseText == "") {
alert('null')
$(this).jqGrid('setGridParam', { datatype: 'json' }).trigger('reloadGrid');//Reloads the grid after edit
return [true, '']
}
else {
$(this).jqGrid('setGridParam', { datatype: 'json' }).trigger('reloadGrid'); //Reloads the grid after edit
return [false, response.responseText]//Captures and displays the response text on th Edit window
}
},
editData: {
EmpId: function () {
var sel_id = $('#table_list_2').jqGrid('getGridParam', 'selrow');
var value = $('#table_list_2').jqGrid('getCell', sel_id, 'Id');
return value;
}
},
},
{
//add
closeAfterAdd: true,//Closes the add window after add
clearAfterAdd:true,
afterSubmit: function (response, postdata) {
if (response.responseText == "") {
$(this).jqGrid('setGridParam',
{ datatype: 'json' }, "first").trigger('reloadGrid')//Reloads the grid after Add
return [true, '']
}
else {
$(this).jqGrid('setGridParam',
{ datatype: 'json' }, "first").trigger('reloadGrid')//Reloads the grid after Add
return [false, response.responseText]
}
}
}
Jqgrid add后添加数据的层没自动关闭
closeAfterAdd:true
jqGrid怎么批量添加JSON数据?addJSonData怎么用
可以看到addJSONData接受的并不是一个数组,就是一个json对象,开始一直也困扰在这里。前台返回的JSON:{"total":"1","page":"1","records":"3","rows":[{"UserID":1,"UserName":"kp","Password":"123","Domain":null,"RoleID":null},{"UserID":2,"UserName":"kptest","Password":...
jqgrid 怎么改变编辑框的位置和大小
forceFit:true,emptyrecords:"没有符合数据",caption: ""}).navGrid('#pagerb',{ add: true,addtext: "添加 ",del: false,edit: true,edittext: "修改 ",position: "left",view: true,viewtext: "查看 ",search: false,refreshtitle: "刷新",refreshtext: "刷新 ",alertcap: "提示信息...
jqgrid 用代码添加列数据
onCellSelect:function(rowid,col,cellcontent){ var selectthis = $(this); if(col===5 && cellcontent == "暂时不能操作"){ selectthis.setCell(rowid,5,'可以操作'); }},afterInsertRow: function(rowid, aData){ var selectthis = $(this); var modify = true; for(var i=0;i<...
Jqgrid 如何根据url参数的变化刷新表格内容?
大体流程是这样的:首先你说的那个组织目录呢,在他点击的时候会链到不同的页面显示不同的数据!加载JQGrid url会找相应的action,查询数据,然后回显! 这里有段jqGrid的代码,仅供参考!jsp页面<%@ page language="java" pageEncoding="utf-8"%><%@ taglib uri="\/sys-tags" prefix="tl"%><!
jqgrid的checkbox筛选框如何显示在最后一列
添加checkboxprotectedvoidPage_Load(objectsender,EventArgse){CheckBoxchk=newCheckBox();chk.Text="testall";\/\/这里可以换成数据库的内容chk.CheckedChanged+=newEventHandler(chk_CheckedChanged);chk.AutoPostBack=true;Page.Form.Controls.Add(chk);for(inti=0;i<10;i++){CheckBoxchk2=newCheckBox()...
jqGrid怎么批量添加JSON数据?addJSonData怎么用?
可以看到addJSONData接受的并不是一个数组,就是一个json对象,开始一直也困扰在这里。前台返回的JSON:{"total":"1","page":"1","records":"3","rows":[{"UserID":1,"UserName":"kp","Password":"123","Domain":null,"RoleID":null},{"UserID":2,"UserName":"kptest","Password":...
jqGrid怎么批量添加JSON数据?addJSonData怎么用?
可以看到addJSONData接受的并不是一个数组,就是一个json对象,开始一直也困扰在这里。前台返回的JSON:{"total":"1","page":"1","records":"3","rows":[{"UserID":1,"UserName":"kp","Password":"123","Domain":null,"RoleID":null},{"UserID":2,"UserName":"kptest","Password":...