我在一个页面中有两个jqgrid但我的问题是当我点击第一个网格第一行的添加按钮进入编辑模式时它很好但是当我点击时添加第二个网格编辑模式的按钮来自第二个grisd instate的第二行第2行第一行任何解决方案提前感谢
var grid1 = new JQGrid(Name: "ReceiptdetGrid", LoadUrl: "/Receipt/GetGridData",
Columns: new List<JQGridColumn>() {
new JQGridColumn(Name: "Id",ColHeader: "Id", DataType: "string", IsSortable:false, IsFixed:true, IsResize: true,Hidden:true, Width:"0%"),
new JQGridColumn(Name: "Sno",ColHeader: "SNo.", DataType: "string", IsSortable:false, Width:"10%", IsFixed:true, IsResize: true,Hidden:false),
new JQGridColumn(Name: "HeadName",ColHeader: "Head", DataType: "string", IsSortable:true, IsFixed:true, IsResize: true,Width:"45%",IsEditable:true,EditType:"select",Items:(ViewData["headlist"] as List<SelectListItem>),OnChange:"SelectheadChange"),
new JQGridColumn(Name: "Amount",ColHeader: " Amount", DataType: "string",EditType:"text", Width:"45%", IsSortable:false,OnKeyUp:"CalculateTotalAmmount",IsFixed:true, IsResize: true,Hidden:false,IsEditable:true),
}, IsPaging: true, PageSize: "8", EditUrl: "/Receipt/KeepGridData", DeleteUrl: "/Receipt/DeleteGridData", IsSortable: true, FooterRow: true, ShowEmptyRows: true, EditType: JQGridEditType.Inline, IsEdit: true, IsDelete: true, IsInsert: true, Width: "900", Height: "200");
@grid1.GetHtml();
}
第二次jqgrid
var grid2 = new JQGrid(Name: "instru", LoadUrl: "/Receipt/GetGridData",
Columns: new List<JQGridColumn>() {
new JQGridColumn(Name: "Id1",ColHeader: "Id1", DataType: "string", IsSortable:false, IsFixed:true, IsResize: true,Hidden:true, Width:"0%"),
new JQGridColumn(Name: "type",ColHeader: "type", DataType: "string", IsSortable:false, Width:"10%", IsFixed:true, IsResize: true,Hidden:false),
new JQGridColumn(Name: "HeadName",ColHeader: "Head", DataType: "string", IsSortable:true, IsFixed:true, IsResize: true,Width:"45%",IsEditable:true,EditType:"select",Items:(ViewData["headlist"] as List<SelectListItem>),OnChange:"SelectheadChange"),
new JQGridColumn(Name: "Amount",ColHeader: " Amount", DataType: "string",EditType:"text", Width:"45%", IsSortable:false,OnKeyUp:"CalculateTotalAmmount",IsFixed:true, IsResize: true,Hidden:false,IsEditable:true),
}, IsPaging: true, PageSize: "8", EditUrl: "/Receipt/KeepGridData", DeleteUrl: "/Receipt/DeleteGridData", IsSortable: true, FooterRow: true, ShowEmptyRows: true, EditType: JQGridEditType.Inline, IsEdit: true, IsDelete: true, IsInsert: true, Width: "900", Height: "200");
@grid2.GetHtml();
}
当我ckeck添加第1个网格的按钮来的时候,但是当我点击添加第2个网格的按钮的时候第2行而不是第2个网格的第1行感谢提前
答案 0 :(得分:0)
我不确定你是如何处理后端的所有内容的,但看起来你在两个网格中都遇到了相同的网址:
负载:
LoadUrl: "/Receipt/GetGridData"
编辑:
EditUrl: "/Receipt/KeepGridData"
删除:
DeleteUrl: "/Receipt/DeleteGridData"
因此,除非我弄错了,否则你基本上可能已经制作了两个使用相同界面的网格。同样,它实际上取决于后端页面如何处理来自这两个网格的加载,编辑和删除请求。