亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

JQuery Grid-SubGrid用于父子關系

JQuery Grid-SubGrid用于父子關系

胡說叔叔 2019-11-04 09:44:02
我需要一些有關如何在以下sceaniro中實現子網格的想法。以下是我想在JQuery Grid和Subgrid中顯示的json數據?;旧?,我得到了一個名為“ Contact”的對象,該對象具有一個名為“ actionSet”的集合。{ "total" : "10", "page" : "1", "records" : "78", "rows" : [ {   "comment" : null,   "givenName" : "Contact A",   "familyName" : "A",   "actionSet" : [ {       "actionID" : 1,       "actionDueDate" : "2012-12-08",       "actionNote" : "Action 1"       }, {       "actionID" : 2,       "actionDueDate" : "2012-12-08",       "actionNote" : "Action 2"  } ] }    ...]}我希望每個網格行都顯示“聯系人”,并且與網格關聯的子網格應顯示“ actionSet”集合。當選擇了網格中的特定行時,我不想進行服務器調用以獲取關聯的動作,因為它們已經存在于“ actionSet”中。我已經使Grid正常工作,很好地顯示了“ Contacts”,但是在實現子網格時,由于如何獲取其數據而感到困惑,因為它已經可以在json中使用了。jq(function() { jq("#grid").jqGrid({ url:'/smallworks/project/getall.do', datatype: 'json', mtype: 'GET',   colNames:['Id', 'First Name', 'Last Name'],   colModel:[     {name:'id',index:'id', width:55,editable:false,editoptions:   {readonly:true,size:10},hidden:true},   {name:'givenName',index:'givenName', width:100,editable:true, editrules:{required:true}, editoptions:{size:10}},   {name:'familyName',index:'familyName', width:100,editable:true, editrules:{required:true}, editoptions:{size:10}}  ],  postData: {  },  rowNum:20,  rowList:[20,40,60],  height: 200,  autowidth: true,  rownumbers: true,  pager: '#pager',  sortname: 'id',  viewrecords: true,  sortorder: "asc",  caption:"Contacts",  emptyrecords: "Empty records",  loadonce: false,  loadComplete: function() {  },這可以實現嗎?我是否需要專門為子網格解析JSON數據?如何做到這一點?
查看完整描述

3 回答

  • 3 回答
  • 0 關注
  • 666 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號