小幸福520 2016-12-06 03:10 采纳率: 0%
浏览 868

这段代码什么意思?数据在后台如何传过来的?

```var storeCfg = {
url : actionName + '?method=findAllUserByLoginUser',
totalProperty : 'total',
successProperty : 'success',
root : 'voRecords',
fields : [ 'userId', 'userAccount', 'empId', 'userName',
'userStatus', 'userType', 'remark', {
name : "timeStamp",
mapping : "timeStamp",
convert : function(v, record) {
return v.split('T')[0];
}
}, 'orgId', 'orgName', 'deptName', 'positionName', {
name : "expireDate",
mapping : "expireDate",
convert : function(v, record) {
if (v != null) {
return v.split('T')[0];
} else {
return '';
}
}
}, 'mac1', 'mac2', 'position', 'phone', {
name : "passEndDate",
mapping : "passEndDate",
convert : function(v, record) {
if (v == null) {
return '';
} else {
return v.split('T')[0];
}
}
}, {
name : "isExport",
mapping : "isExport"
} ]
};

    var jsonReader = new Ext.data.JsonReader(storeCfg);
    var dataStore = new Ext.data.JsonStore(storeCfg);

    var results = [
            {
                id : 'userId',
                header : '用户主键',
                dataIndex : 'userId',
                hidden : true
            },
            {
                id : 'userAccount',
                header : '用户号',
                dataIndex : 'userAccount',
                width : 100
            },
            {
                id : 'userName',
                header : '用户名称',
                dataIndex : 'userName',
                width : 100
            },
            {
                id : 'orgName',
                header : '机构名称',
                dataIndex : 'orgName',
                width : 120
            },
            {
                id : 'deptName',
                header : '部门名称',
                dataIndex : 'deptName',
                width : 120
            },


            {
                id : 'roleName',
                header : '角色名称',
                dataIndex : 'roleName',
                width : 120,
                renderer : function(value) {

                    if (value == '')
                        return '正常';
                    else 
                        return '未分配角色';
                }
            },


            {
                id : 'userStatus',
                header : '是否锁定',
                dataIndex : 'userStatus',
                width : 70,
                renderer : function(value) {

                    if (value == '0')
                        return '正常';
                    else if (value == '1')
                        return '锁定';
                }
            },
            {
                id : 'timeStamp',
                header : '创建日期',
                dataIndex : 'timeStamp',
                width : 85
            },
            /*
            {
                id : 'expireDate',
                header : '过期日期',
                dataIndex : 'expireDate',
                width : 85
            },  */
            {
                id : 'mac1',
                header : 'MAC1',
                dataIndex : 'mac1',
                hidden : true,
                width : 120
            },
            {
                id : 'mac2',
                header : 'MAC2',
                dataIndex : 'mac2',
                hidden : true,
                width : 120
            },
            {
                id : 'positionName',
                header : '职位',
                dataIndex : 'positionName',
                width : 120
            },
            {
                id : 'phone',
                header : '联系电话',
                dataIndex : 'phone',
                width : 120
            },
            {
                id : 'isExport',
                header : '登陆系统方式',
                dataIndex : 'isExport',
                width : 90,
                renderer : function(value, cellmeta, record, rowIndex,
                        columnIndex, store) {
                    if ('0' == value) {
                        return '本系统登陆';
                    } else if ('1' == value) {
                        return 'Portal登陆';
                    } else {
                        return '两者均可';
                    }
                }
            }, {
                id : 'remark',
                header : '备注',
                dataIndex : 'remark',
                width : 120
            } ];

    var btn_add = new Ext.Button( {
        text : '添加',
        iconCls : 'icon-add',
        handler : function() {

            /*
             * Ext.Ajax.request({ url: actionName +
             * '?method=findOrgNameById&oId=0', params : { id:0 }, success :
             * function(response,options) { //
             * Ext.getCmp('updatekeyWord').setValue(response.responseText);
             * 
             * 
             * },failure: function(form, action) { Ext.Msg.show( { title :
             * '错误提示', msg : action.result.error.message, buttons :
             * Ext.Msg.OK, icon : Ext.Msg.ERROR } ); } } );
             */

            window_add.show(); // 点击按钮后显示新增窗体
        orgId.setRawValue('');
        orgid_hidden.setRawValue('');
    }
    });

  • 写回答

4条回答 默认 最新

  • 传说中的神话灬 2016-12-06 03:17
    关注

    用JSON数组是不是有点复杂,可不可以考虑直接用JSON呢?

    评论

报告相同问题?

悬赏问题

  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况
  • ¥15 画两个图 python或R
  • ¥15 在线请求openmv与pixhawk 实现实时目标跟踪的具体通讯方法
  • ¥15 八路抢答器设计出现故障
  • ¥15 opencv 无法读取视频
  • ¥15 按键修改电子时钟,C51单片机
  • ¥60 Java中实现如何实现张量类,并用于图像处理(不运用其他科学计算库和图像处理库))
  • ¥20 5037端口被adb自己占了