EasyUI TreeGrid 后台请求json格式的数据,页面不能正常显示数据求大神指导!

二哥学Java 发布于 2016/08/18 14:22
阅读 1K+
收藏 0
EasyUI TreeGrid 后台请求json格式的数据,页面不能正常显示数据求大神指导!

jsp页面的模板HTML
<script type="text/template" id="template_assign_resource_to_user_div222">
<div id="list_user_dialog" class="dialog_modal" style="display: none;">
<div class="head drag">
<span>分配用户</span>
<a class="modal-close"></a>
</div>
<div class="main-content">
<div id="p" class="easyui-panel" title="My Panel" iconCls="icon-save" collapsible="true">
<table title="Folder Browser" class="easyui-treegrid" style="width:700px;height:250px" id="tb222"></table>
</div>
</div>
</div>
</script>
点击按钮触发事件(这个里面用到了PopupLayer弹出层插件),ajax从后获取json格式的字符串
$('#act_assign222').click(function() {
        var checkboxs = [];
        $("input[name=items]:checked").each(function(index) {
            checkboxs.push($(this).val());
        });
        if (checkboxs.length == 0) {
            var poptip = buildCcommonMsg("#commonMsg_trigger", "提示", "请选择!", function() {});
            return false;
        }
        var assign_user_dlg_html222 = $($("#template_assign_resource_to_user_div222").html()).clone();
        var selectUserDlg = new PopupLayer().rebuild({
                trigger: "#act_assign222",
                 popupBlk: assign_user_dlg_html222
             });

            $.ajax({
                url: baseBath+'acl/resource/getAllUserAclReturnJson222',
                type: "POST",
                traditional: true,
                data: {
                    "aclResourceId": checkboxs[0],
                    "type": "VM"
                },
                success: function(data) {
                 //这里开始构建tree
                 $("#tt222").treegrid({ 
                         url:data, 
                         idField: 'id',
                         treeField:'uName',
                        columns:[[
                            {field:'uName',title:'用户名',width:100},
                           {field:'uId',title:'用户 Id',width:100},
                            {field:'sourceId',title:'资源Id',width:100,align:'right'}
                            ]]
                    });
                },
                error: function(data) {
                    var poptip = buildCcommonMsg("#act_distribute", "提示", data.responseText, function() {});
                    return false;
                }
            });
        });

获取到的json格式的data
[{
"childrenList": [{
"childrenList": [],
"id": 2,
"isChecked": false,
"isManage": false,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": null,
"customerId": "CIDC-A-a495c0b8650d4eb0a4d8f6fbf4bfe11b",
"customerType": "xxx",
"email": "",
"headicon": [],
"id": "13",
"informType": 0,
"isCustomer": 0,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": null,
"loginFailedCount": 0,
"nickname": "test1.2",
"org": "00a710895464432b913f3d69555166bf",
"orgName": "",
"password": "",
"role": "",
"telephone": "",
"type": 1,
"userStatus": 1,
"username": ""
},
"parentId": "CIDC-U-fb43bdbbe4524550b620b863f32302da",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "13",
"uName": ""
},
{
"childrenList": [],
"id": 3,
"isChecked": false,
"isManage": false,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": null,
"customerId": "CIDC-A-003ed691221e4438a4379acb5e0a07ac",
"customerType": "互联网客户",
"email": "",
"headicon": [],
"id": "2",
"informType": 0,
"isCustomer": 0,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": null,
"loginFailedCount": 0,
"nickname": "test1.1",
"org": "00a710895464432b913f3d69555166bf",
"orgName": "",
"password": "",
"role": "",
"telephone": "",
"type": 1,
"userStatus": 1,
"username": "test1.1"
},
"parentId": "CIDC-U-fb43bdbbe4524550b620b863f32302da",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "2",
"uName": "test1.1"
},
{
"childrenList": [],
"id": 4,
"isChecked": false,
"isManage": false,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": {
"date": 25,
"day": 6,
"hours": 12,
"minutes": 29,
"month": 5,
"seconds": 33,
"time": 1466828973000,
"timezoneOffset": -480,
"year": 116
},
"customerId": "CIDC-A-003ed691221e4438a4379acb5e0a07ac",
"customerType": "互联网客户",
"email": "xxx2@139.com",
"headicon": [],
"id": "CIDC-U-501deda706bf48a081d27fcaa0752bc0",
"informType": 1,
"isCustomer": 0,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": {
"date": 25,
"day": 6,
"hours": 12,
"minutes": 29,
"month": 5,
"seconds": 33,
"time": 1466828973000,
"timezoneOffset": -480,
"year": 116
},
"loginFailedCount": 0,
"nickname": "yangxuemei",
"org": "00a710895464432b913f3d69555166bf",
"orgName": "",
"password": "ed1dad90cc277aa80dc86163ded41fc0ba1b1d46d1431845af2cbaca5841d12c",
"role": "",
"telephone": "xxx",
"type": 2,
"userStatus": 1,
"username": "com-yxm"
},
"parentId": "CIDC-U-fb43bdbbe4524550b620b863f32302da",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "CIDC-U-501deda706bf48a081d27fcaa0752bc0",
"uName": "com-yxm"
},
{
"childrenList": [],
"id": 5,
"isChecked": false,
"isManage": false,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": {
"date": 24,
"day": 5,
"hours": 21,
"minutes": 33,
"month": 5,
"seconds": 35,
"time": 1466775215000,
"timezoneOffset": -480,
"year": 116
},
"customerId": "CIDC-A-a495c0b8650d4eb0a4d8f6fbf4bfe11b",
"customerType": "xxx",
"email": "212@313",
"headicon": [],
"id": "CIDC-U-50c05040b3144e0cb1f4cb4dc01a7a3b",
"informType": 1,
"isCustomer": 0,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": {
"date": 24,
"day": 5,
"hours": 21,
"minutes": 33,
"month": 5,
"seconds": 35,
"time": 1466775215000,
"timezoneOffset": -480,
"year": 116
},
"loginFailedCount": 0,
"nickname": "adfaf",
"org": "00a710895464432b913f3d69555166bf",
"orgName": "",
"password": "ed1dad90cc277aa80dc86163ded41fc0ba1b1d46d1431845af2cbaca5841d12c",
"role": "",
"telephone": "18800009999",
"type": 2,
"userStatus": 1,
"username": "xxx.com-resr"
},
"parentId": "CIDC-U-fb43bdbbe4524550b620b863f32302da",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "CIDC-U-50c05040b3144e0cb1f4cb4dc01a7a3b",
"uName": "xxx.com-resr"
},
{
"childrenList": [],
"id": 6,
"isChecked": false,
"isManage": false,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": {
"date": 13,
"day": 1,
"hours": 10,
"minutes": 26,
"month": 5,
"seconds": 57,
"time": 1465784817000,
"timezoneOffset": -480,
"year": 116
},
"customerId": "CIDC-A-a495c0b8650d4eb0a4d8f6fbf4bfe11b",
"customerType": "xxx",
"email": "111@qq.com",
"headicon": [],
"id": "CIDC-U-6d3e6f0ab2554154a3a11aa66a82abeb",
"informType": 1,
"isCustomer": 0,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": {
"date": 13,
"day": 1,
"hours": 10,
"minutes": 26,
"month": 5,
"seconds": 57,
"time": 1465784817000,
"timezoneOffset": -480,
"year": 116
},
"loginFailedCount": 0,
"nickname": "test",
"org": "00a710895464432b913f3d69555166bf",
"orgName": "",
"password": "ed1dad90cc277aa80dc86163ded41fc0ba1b1d46d1431845af2cbaca5841d12c",
"role": "",
"telephone": "xxx",
"type": 2,
"userStatus": 1,
"username": "xxx.com-user1"
},
"parentId": "CIDC-U-fb43bdbbe4524550b620b863f32302da",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "CIDC-U-6d3e6f0ab2554154a3a11aa66a82abeb",
"uName": "xxx.com-user1"
},
{
"childrenList": [],
"id": 7,
"isChecked": false,
"isManage": false,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": {
"date": 24,
"day": 5,
"hours": 21,
"minutes": 34,
"month": 5,
"seconds": 28,
"time": 1466775268000,
"timezoneOffset": -480,
"year": 116
},
"customerId": "CIDC-A-a495c0b8650d4eb0a4d8f6fbf4bfe11b",
"customerType": "xxx",
"email": "212@313",
"headicon": [],
"id": "CIDC-U-8e890e3b78f547faafbc9e840ae7fc5f",
"informType": 1,
"isCustomer": 0,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": {
"date": 24,
"day": 5,
"hours": 21,
"minutes": 34,
"month": 5,
"seconds": 28,
"time": 1466775268000,
"timezoneOffset": -480,
"year": 116
},
"loginFailedCount": 0,
"nickname": "adfaf",
"org": "00a710895464432b913f3d69555166bf",
"orgName": "",
"password": "ed1dad90cc277aa80dc86163ded41fc0ba1b1d46d1431845af2cbaca5841d12c",
"role": "",
"telephone": "18800009933",
"type": 2,
"userStatus": 1,
"username": "xxx.com-resr123"
},
"parentId": "CIDC-U-fb43bdbbe4524550b620b863f32302da",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "CIDC-U-8e890e3b78f547faafbc9e840ae7fc5f",
"uName": "xxx.com-resr123"
},
{
"childrenList": [],
"id": 8,
"isChecked": false,
"isManage": false,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": {
"date": 24,
"day": 5,
"hours": 21,
"minutes": 41,
"month": 5,
"seconds": 5,
"time": 1466775665000,
"timezoneOffset": -480,
"year": 116
},
"customerId": "CIDC-A-a495c0b8650d4eb0a4d8f6fbf4bfe11b",
"customerType": "xxx",
"email": "xxx1@139.com",
"headicon": [],
"id": "CIDC-U-9a1fecd8c8734eaa89dda8780e2f8998",
"informType": 1,
"isCustomer": 0,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": {
"date": 24,
"day": 5,
"hours": 21,
"minutes": 41,
"month": 5,
"seconds": 5,
"time": 1466775665000,
"timezoneOffset": -480,
"year": 116
},
"loginFailedCount": 0,
"nickname": "11asdf",
"org": "00a710895464432b913f3d69555166bf",
"orgName": "",
"password": "ed1dad90cc277aa80dc86163ded41fc0ba1b1d46d1431845af2cbaca5841d12c",
"role": "",
"telephone": "18822222222",
"type": 2,
"userStatus": 1,
"username": "xxx.com-adfa111"
},
"parentId": "CIDC-U-fb43bdbbe4524550b620b863f32302da",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "CIDC-U-9a1fecd8c8734eaa89dda8780e2f8998",
"uName": "xxx.com-adfa111"
},
{
"childrenList": [{
"childrenList": [],
"id": 10,
"isChecked": false,
"isManage": false,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": null,
"customerId": "CIDC-A-a495c0b8650d4eb0a4d8f6fbf4bfe11b",
"customerType": "xxx",
"email": "",
"headicon": [],
"id": "5",
"informType": 0,
"isCustomer": 0,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": null,
"loginFailedCount": 0,
"nickname": "test2.1",
"org": "b2",
"orgName": "A",
"password": "",
"role": "",
"telephone": "",
"type": 1,
"userStatus": 1,
"username": "tets2.1"
},
"parentId": "3",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "5",
"uName": "tets2.1"
},
{
"childrenList": [{
"childrenList": [],
"id": 12,
"isChecked": false,
"isManage": false,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": null,
"customerId": "CIDC-A-a495c0b8650d4eb0a4d8f6fbf4bfe11b",
"customerType": "xxx",
"email": "",
"headicon": [],
"id": "10",
"informType": 0,
"isCustomer": 0,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": null,
"loginFailedCount": 0,
"nickname": "test3.2",
"org": "b5",
"orgName": "C",
"password": "",
"role": "",
"telephone": "",
"type": 1,
"userStatus": 1,
"username": "test3.2"
},
"parentId": "6",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "10",
"uName": "test3.2"
},
{
"childrenList": [],
"id": 13,
"isChecked": false,
"isManage": false,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": null,
"customerId": "CIDC-A-a495c0b8650d4eb0a4d8f6fbf4bfe11b",
"customerType": "xxx",
"email": "",
"headicon": [],
"id": "9",
"informType": 0,
"isCustomer": 0,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": null,
"loginFailedCount": 0,
"nickname": "test3.1",
"org": "b5",
"orgName": "C",
"password": "",
"role": "",
"telephone": "",
"type": 1,
"userStatus": 1,
"username": "test3.1"
},
"parentId": "6",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "9",
"uName": "test3.1"
}],
"id": 11,
"isChecked": false,
"isManage": true,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": null,
"customerId": "CIDC-A-003ed691221e4438a4379acb5e0a07ac",
"customerType": "互联网客户",
"email": "",
"headicon": [],
"id": "6",
"informType": 0,
"isCustomer": 1,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": null,
"loginFailedCount": 0,
"nickname": "二级子部门1",
"org": "b5",
"orgName": "C",
"password": "",
"role": "",
"telephone": "",
"type": 1,
"userStatus": 1,
"username": "admin2.1"
},
"parentId": "3",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "6",
"uName": "admin2.1"
}],
"id": 9,
"isChecked": false,
"isManage": true,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": null,
"customerId": "CIDC-A-003ed691221e4438a4379acb5e0a07ac",
"customerType": "互联网客户",
"email": "",
"headicon": [],
"id": "3",
"informType": 0,
"isCustomer": 1,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": null,
"loginFailedCount": 0,
"nickname": "一级子部门",
"org": "b2",
"orgName": "A",
"password": "",
"role": "",
"telephone": "",
"type": 1,
"userStatus": 1,
"username": "admin1.1"
},
"parentId": "CIDC-U-fb43bdbbe4524550b620b863f32302da",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "3",
"uName": "admin1.1"
},
{
"childrenList": [{
"childrenList": [],
"id": 11,
"isChecked": false,
"isManage": false,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": null,
"customerId": "CIDC-A-a495c0b8650d4eb0a4d8f6fbf4bfe11b",
"customerType": "xxx",
"email": "",
"headicon": [],
"id": "7",
"informType": 0,
"isCustomer": 0,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": null,
"loginFailedCount": 0,
"nickname": "test2.2",
"org": "b3",
"orgName": "B",
"password": "",
"role": "",
"telephone": "",
"type": 1,
"userStatus": 1,
"username": "test2.2"
},
"parentId": "4",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "7",
"uName": "test2.2"
},
{
"childrenList": [{
"childrenList": [],
"id": 13,
"isChecked": false,
"isManage": false,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": null,
"customerId": "CIDC-A-a495c0b8650d4eb0a4d8f6fbf4bfe11b",
"customerType": "xxx",
"email": "",
"headicon": [],
"id": "11",
"informType": 0,
"isCustomer": 0,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": null,
"loginFailedCount": 0,
"nickname": "test3.3",
"org": "b8",
"orgName": "F",
"password": "",
"role": "",
"telephone": "",
"type": 1,
"userStatus": 1,
"username": "test3.3"
},
"parentId": "8",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "11",
"uName": "test3.3"
},
{
"childrenList": [],
"id": 14,
"isChecked": false,
"isManage": false,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": null,
"customerId": "CIDC-A-a495c0b8650d4eb0a4d8f6fbf4bfe11b",
"customerType": "xxx",
"email": "",
"headicon": [],
"id": "12",
"informType": 0,
"isCustomer": 0,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": null,
"loginFailedCount": 0,
"nickname": "test3.4",
"org": "b8",
"orgName": "F",
"password": "",
"role": "",
"telephone": "",
"type": 1,
"userStatus": 1,
"username": "test3.4"
},
"parentId": "8",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "12",
"uName": "test3.4"
}],
"id": 12,
"isChecked": false,
"isManage": true,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": null,
"customerId": "CIDC-A-003ed691221e4438a4379acb5e0a07ac",
"customerType": "互联网客户",
"email": "",
"headicon": [],
"id": "8",
"informType": 0,
"isCustomer": 1,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": null,
"loginFailedCount": 0,
"nickname": "二级资本们2",
"org": "b8",
"orgName": "F",
"password": "",
"role": "",
"telephone": "",
"type": 1,
"userStatus": 1,
"username": "admin2.2"
},
"parentId": "4",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "8",
"uName": "admin2.2"
}],
"id": 10,
"isChecked": false,
"isManage": true,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": null,
"customerId": "CIDC-A-003ed691221e4438a4379acb5e0a07ac",
"customerType": "互联网客户",
"email": "",
"headicon": [],
"id": "4",
"informType": 0,
"isCustomer": 1,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": null,
"loginFailedCount": 0,
"nickname": "一级子部门",
"org": "b3",
"orgName": "B",
"password": "",
"role": "",
"telephone": "",
"type": 1,
"userStatus": 1,
"username": "admin1.2"
},
"parentId": "CIDC-U-fb43bdbbe4524550b620b863f32302da",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "4",
"uName": "admin1.2"
}],
"id": 1,
"isChecked": false,
"isManage": true,
"opUser": {
"authoritys": [],
"createdBy": "",
"createdDate": {
"date": 26,
"day": 5,
"hours": 10,
"minutes": 36,
"month": 1,
"seconds": 36,
"time": 1456454196000,
"timezoneOffset": -480,
"year": 116
},
"customerId": "CIDC-A-003ed691221e4438a4379acb5e0a07ac",
"customerType": "互联网客户",
"email": "xxx.com",
"headicon": [],
"id": "CIDC-U-fb43bdbbe4524550b620b863f32302da",
"informType": 1,
"isCustomer": 1,
"isHuawei": 0,
"lastUpdatedBy": "",
"lastUpdatedDate": {
"date": 26,
"day": 5,
"hours": 10,
"minutes": 36,
"month": 1,
"seconds": 36,
"time": 1456454196000,
"timezoneOffset": -480,
"year": 116
},
"loginFailedCount": 0,
"nickname": "xxx.com",
"org": "00a710895464432b913f3d69555166bf",
"orgName": "",
"password": "ed1dad90cc277aa80dc86163ded41fc0ba1b1d46d1431845af2cbaca5841d12c",
"role": "buy_vm",
"telephone": "188222222222",
"type": 0,
"userStatus": 1,
"username": "xxx.com"
},
"parentId": "0",
"sourceId": "00ee879e-af15-4a78-a258-b6a4be701a8e",
"uId": "CIDC-U-fb43bdbbe4524550b620b863f32302da",
"uName": "xxx.com"
}]
结果出来没有数据,大神给看看!!!!

加载中
返回顶部
顶部