日期:2014-05-16  浏览次数:20349 次

EXTJS 遇到的函数定义问题,请高人指点,谢谢
JScript code



function callback_${param.cmpId}(cmp){   
    var tree = new Ext.tree.TreePanel({
        title: '组织机构',
         region: 'west',
         collapsible: true,
        autoScroll : false,
        rootVisible : true,
        autoScroll : true,
        width: 210,
        bodyStyle: 'background:white',
        margins: '0 5 0 0',
        root : new Ext.tree.AsyncTreeNode({
            text: '组织机构',
            expanded: true,
            id: 0
        }),
        loader: new Ext.tree.TreeLoader({
            dataUrl: baseURL+'/orgAction!loadOrgTree.page',
            baseParams: {}
        }),
        listeners: {
            click: function(node) {
               var treeNodeId = node.attributes.id;
               organisationStore.load({params:{orgId: treeNodeId}});
            },
            scope: this
        }
    });
    
    var organisationStore = new Ext.data.Store({
        proxy: new Ext.data.HttpProxy({
            url: baseURL + '/userAction!searchUser.page',
            method: 'POST'
        }),
        reader: new Ext.data.JsonReader({
            root: 'data',
            idProperty: 'Id',
            totalProperty: 'totalCount',
            successProperty: 'success'
        }, [
            {name: 'Id'},
            {name: 'UserName'},
            {name: 'UserRealName'},
            {name: 'IsActive'}
        ])
    });

    var gridTbr = new Ext.Toolbar({
        items: [
        {text: '新增',iconCls:'addIcon',
            handler: function(){
                openNewWin(grid);
            }
        },
        {text: '修改',iconCls:'edit1Icon',
            handler: function(){
                openEidtWin(grid);
            }
        },
        {text: '删除',iconCls:'deleteIcon',
            handler: function(){
                delRecord(grid);
            }
        },'-',
        {text: '锁定',iconCls:'lockIcon',
            handler: function(){
            unactiveuser(grid);
            }
            },
        {text: '解锁',iconCls:'lockOpen',
        handler: function(){
            activeuser(grid);
            }
    },'-',
        {text: '所属部门',iconCls:'award_star_bronze_3',
            handler: function(){
            openEidtPart(grid);
            }
           },
            
        {text: '所属角色',iconCls:'award_star_bronze_3',
               handler: function(){
            openEidtWin(grid);
            
            }
        }
        
    ]});
    var sm = new Ext.grid.CheckboxSelectionModel();

    var grid = new Ext.grid.GridPanel({
        region: 'center',
        tbar: gridTbr,
        store: organisationStore,
        sm: sm,
        columns: [
                  sm,
                  {header: '编号',dataIndex: 'Id'},
                  {header: '用户姓名',dataIndex: 'UserRealName'},
                  {header: '用户帐号',dataIndex: 'UserName'},
                  {header: '状态',dataIndex: 'IsActive',renderer: function(value){
                      return value == '1' ? '活动': '锁定';
                  }}
        ],
        loadMask : {
            msg : '数据加载中,请稍后...'
        },
        viewConfig: {forceFit: true},
        stripeRows: true,
        autoExpandColumn: 'orgainsation',
        bbar: new Ext.PagingToolbar({
            store: organisationStore,
            pageSize: 50
        }),
        listeners: {
            afterrender: function(cmp){
                organisationStore.load({params: {start:0, limit:25}});
            },
            rowdblclick: function(cmp,rowIndex,e){
                openEidtWin(cmp);
            }
        }
    });
    
    
    var layoutPanel = new Ext.ux.LayoutComponent({
        columns: 4,
        frame: false,
        border: false,
        title: '查询',
        spadding: '10',
        items: [{
            xtype: 'textfield',
            fieldLabel: '动作名称',
            emptyText:''
        },{