extjs框架之简单的实现

Ext.namespace("onesun.menuManage.MenuManageUI");//引入被封装的页面路径
    onesun.menuManage.MenuManageUI = function() {                
    var init = function() {//初始化函数并在返回一个页面组件如:按钮、边框等以及控制页面的宽、高度。
                return {
                xtype:'panel',
                layout:'border',
                height:getPanelHeight(),
                anchor:'100%',        
                items :[menu(),treePanel()],
                bbar : [
                        {text : basicConstant.BUTTON_ADD,
                            iconCls : 'add_item',                        
                        handler : addBranch
                        }, '-', {
                        text : '修改',
                        iconCls : 'edit_item',                    
                        handler : updateBranch
                        }, '-', {
                        text : '删除',
                        iconCls : 'delete_item',        
                        handler : deleteBranch
                        }     
                        
                        ]
                };                
                    }
    
            var addBranch = function(){
                
                
            }
            var updateBranch = function(){
                    
                    
                }
            var deleteBranch = function(){
                
                
            }
     var menu = function (){
              return {
                      title : "菜单列表",
                      border : true,
                    region : 'center',
                    layout : 'fit',
                    items : [menuList()]
                }            
    }
 
     var menuList = function (){
         var grid = new onesun.Widget.GridPanel({
                headTitleList : ',菜单名称,菜单编号,路径,所属机构,机构路径,,机构类型,,,,独立核算,,备注,,,,,,',//表头
                fnRenderer : ',new onesun.GridRender().queryRender,new onesun.GridRender().queryRender,,,,,,,' +
                             'new onesun.GridRender().disableRender,,,,,,,,,,',
                headCols : 'branchId,branchCode,branchName,parentId,parentName,fullPathName,branchTypeId,branchTypeName,mnemonicCode,' +
                           'isDisable,isIndependent,isIndependentText,path,description,fullPath,dtCreate,dtUpdate,isLeaf,phone,address',
                pagingCfg : {pageSize:basicConstant.limit},
                baseParam : {stamp : new Date().getTime(),start : 0,limit:basicConstant.limit},
                remoteFn : 'getBranchList.action',
                remoteUrl : 'branch',
                rowNumber : true,
                sm : new Ext.grid.RowSelectionModel({singleSelect : true}),//是否对本例进行选择
                tbar : [getTwinTriggerField({gridId : ''})],//面板顶部的工具条
                IdColumn : 'branchId',
                
//                rowSelHandler : branchRowHandler,
                autoExpandColumn:'fullPathName',
                rowdblClickHandler:function(sm,index,r){
                    
                  }
        });
        return grid;
         
         
         
         
         
     }  
     

      var treePanel= function(){
             return {
                     xtype : 'onesun_treepanel',
                    region : 'west',
                    hidden : hiddenBranch,                    
                    root : new Ext.tree.AsyncTreeNode({
                        id : '0',
                        text : '菜单分类'
                    }),
              }
          }
        return {
            init:init
        }  
    }


你可能感兴趣的:(前端extjs)