Title: DataGrid create table get json object Post by: mars610 on July 21, 2011, 06:08:47 PM I used DataGrid to create table , the program return json string like this:
[{ "children":[ { "children":[], "createDate":null, "creator":null, "description":"", "groupName":"eeeeeeee", "groupNo":"eeeeee", "isLeaf":0, "localeKey":null, "members":[], "parent":null, "sysId":3, "updateDate":null, "updateOperator":null }], "createDate":null, "creator":null, "description":"", "groupName":"123", "groupNo":"123", "isLeaf":1, "localeKey":null, "members":[], "parent":null, "sysId":1, "updateDate":null, "updateOperator":null }, { "children":[], "createDate":null, "creator":null, "description":"", "groupName":"eeeeeeee", "groupNo":"eeeeee", "isLeaf":0, "localeKey":null, "members":[], "parent":{ "children":[null], "createDate":null, "creator":null, "description":"", "groupName":"123", "groupNo":"123", "isLeaf":1, "localeKey":null, "members":[], "parent":null, "sysId":1, "updateDate":null, "updateOperator":null }, "sysId":3, "updateDate":null, "updateOperator":null }] This string is tree data, I wanna use to create table,so html code like this: <table id="listorg" class="easyui-datagrid" title="<s:text name='list.org.title'/>" url="permission/org!getOrganizationList" nowrap="false" striped="true" toolbar="#tb" idField="sysId" singleSelect="true" pagination="true"> <thead> <tr> <th field="groupNo" width="120"><s:text name="list.org.no" /></th> <th field="groupName" width="120"><s:text name="list.org.name" /></th> <th field="description" width="120"><s:text name="list.org.desc" /></th> <th field="parent" width="120"><s:text name="list.org.parentName" /></th> </tr> </thead> </table> look the red font , if you can't ,look the html colum 'parent',result the page show '[object Object]'. Ok, How should I get the data in the 'parent'? Title: Re: DataGrid create table get json object Post by: stworthy on July 21, 2011, 08:10:52 PM Use 'formatter' function to format your 'parent' field value. Below is the tutorial:
http://www.jeasyui.com/tutorial/datagrid/datagrid7.php |