http://www.iteye.com/problems/44119
http://hi.baidu.com/lapson_85/item/7733586e60b08500a1cf0f8d
————————————————————————————————————————————————————————————————————————————————————————
1. JSON data format:
var map = {"uname": "," upwd ":", "role": {"rolename": "," Rolelevel ": '}}
Bind this JSON format to the DataGrid's filed property:
Columns: [[
{
Field:uname,
Title:uname,
WIDTH:200,
Rowspan:2,
Align: ' center '
},{
Field:upwd,
Title:upwd,
WIDTH:80,
Rowspan:2,
Align: ' center '
}, {
Field: ' Role.rolename ',
Title: ' Role name ',
WIDTH:100,
Rowspan:2,
Align: ' center '
}, {
Field: ' Role. Rolelevel ',
Title: ' Rank ',
WIDTH:80,
Rowspan:2,
Value:1,
Align: ' center '
}]]
jquery Easyui is a data conversion that does not support nested objects. For example: (Role.rolelevel)
We have to modify the source code:
My use of Appendrow and Updaterow 2 methods. So modify the assignment place of these 2 methods
If you use the Appendrow:
Cc.push (_571[_573]); --Source Code 7062 line
Switch
Cc.push (eval ("_571[" "+_573.replace (/\./g," ' ['] ") +" '] ");
If you use the Updaterow:
Cell.html (rows[_57a][_57b]); --Source Code 7638 line
Switch
Cell.html (eval ("rows[_57a][" "+_57b.replace (/\./g," ' ['] ") +" '] ");
Note: The version of my jquery Easyui is 1.2.6 version
Please add QQ Group:100969361
——————————————————————
{field: ' ProductType ', Title: ' Product Category ', Width:160,formatter:function(value,rowdata,rowindex) { // You can try this, right? // return value.prodtype; return rowData.productType.prodType; }},
Easyui DataGrid columns How to get JSON inline objects (Many-to-one POJO Class)