jqGrid子网格不扩展
我按照 www.trirand.com/blog/jqgrid/jqgrid.html 中所示的方式进行操作,
但子网格未展开
这是我的 jqgrid 代码:
jQuery("#list").jqGrid({
url:"../ajax_request/user_table_request.php",
datatype: "json",
mtype : "post",
autoheight:true,
autowidth:true,
colNames:[
"Kode Jabatan Pengguna",
"Id Pengguna",
"Username",
"Nama Pengguna",
"Email",
"Id Jabatan",
"Nama Jabatan"
],
colModel:[
{
name:"id",
index:"kode_jabatan",
align: "center",
width:15,
editable:false,
editoptions:{readonly:true,size:10},
hidden:false
},
{
name:"id_pengguna",
width:10,
editable:false,
editoptions:{readonly:true,size:10},
hidden:false
},
{
width:10,
editable:false,
editoptions:{readonly:true,size:10},
hidden:false
},
{
width:20,
editable:false,
editoptions:{readonly:true,size:20},
hidden:false
},
{
width:10,
editable:false,
editoptions:{readonly:true,size:10},
hidden:false
},
{
name:"id_jabatan",
width:10,
editable:false,
editoptions:{readonly:true,size:10},
hidden:false
},
{
width:10,
editable:false,
editoptions:{readonly:true,size:10},
hidden:false
}
],
rowNum:10,
rowList:[10,20,30,40,50,60,70,80,90,100],
pager: '#pager',
sortname: 'kode_jabatan',
sortorder: "asc",
subGrid : true,
subGridUrl: '../ajax_request/grid_jabatan_request.php',
subGridModel: [
{
name : ['Id Jabatan','Jabatan'],
width : [55,200],
params:['kode_jabatan']
}
],
scrollbar: true
});
jQuery("#list").jqGrid('navGrid','#pager',{edit:true,add:false,del:false,search:false});
jQuery("#list").jqGrid('gridResize',{minWidth:350,maxWidth:800,minHeight:80, maxHeight:350});
我做错了什么? 有人有什么想法吗?
我混淆了 subgrid.js 和 grid.subgrid.js 它们是相同的吗?
I've followed the way shown in www.trirand.com / blog / jqgrid / jqgrid.html
but the subgrid was not expanded
This is my jqgrid code:
jQuery("#list").jqGrid({
url:"../ajax_request/user_table_request.php",
datatype: "json",
mtype : "post",
autoheight:true,
autowidth:true,
colNames:[
"Kode Jabatan Pengguna",
"Id Pengguna",
"Username",
"Nama Pengguna",
"Email",
"Id Jabatan",
"Nama Jabatan"
],
colModel:[
{
name:"id",
index:"kode_jabatan",
align: "center",
width:15,
editable:false,
editoptions:{readonly:true,size:10},
hidden:false
},
{
name:"id_pengguna",
width:10,
editable:false,
editoptions:{readonly:true,size:10},
hidden:false
},
{
width:10,
editable:false,
editoptions:{readonly:true,size:10},
hidden:false
},
{
width:20,
editable:false,
editoptions:{readonly:true,size:20},
hidden:false
},
{
width:10,
editable:false,
editoptions:{readonly:true,size:10},
hidden:false
},
{
name:"id_jabatan",
width:10,
editable:false,
editoptions:{readonly:true,size:10},
hidden:false
},
{
width:10,
editable:false,
editoptions:{readonly:true,size:10},
hidden:false
}
],
rowNum:10,
rowList:[10,20,30,40,50,60,70,80,90,100],
pager: '#pager',
sortname: 'kode_jabatan',
sortorder: "asc",
subGrid : true,
subGridUrl: '../ajax_request/grid_jabatan_request.php',
subGridModel: [
{
name : ['Id Jabatan','Jabatan'],
width : [55,200],
params:['kode_jabatan']
}
],
scrollbar: true
});
jQuery("#list").jqGrid('navGrid','#pager',{edit:true,add:false,del:false,search:false});
jQuery("#list").jqGrid('gridResize',{minWidth:350,maxWidth:800,minHeight:80, maxHeight:350});
what am I doing wrong?
Anybody have any ideas?
I confused subgrid.js and grid.subgrid.js are they same?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
name
属性。目前 7 列中的 4 列没有名称
。colModel
或subGridModel
的name
属性中使用空格。您当前在subGridModel
的name
属性中使用'Id Jabatan'
。subGridUrl
参数定义的 url 提供。您应该验证它是否收到请求并使用正确的 JSON 数据进行应答。name
property for all columns of jqGrid. Currently 4 from 7 columns has noname
.name
property ofcolModel
orsubGridModel
. You use currently'Id Jabatan'
in thename
property ofsubGridModel
.subGridUrl
parameter. You should verify that it receive the request and answer with crrect JSON data.当主网格加载时,所有子网格将自动展开,代码如下:
},
When the main grid loads, all the subgrids will automatically be expanded with the following code:
},