ExtJS4 Ext.create弹出新窗口

  • Post author:
  • Post category:其他



效果图:









Grid.js


Ext.define(‘V5.user.view.Grid’, {




extend : ‘Ext.grid.Panel’,




xtype : ‘userGrid’,




tbar : [{




xtype : ‘basebutton’,



text : ‘新建’,



btype : ‘add’



},



‘->’,



{




xtype : ‘rsearch’,



name : ‘xxx’



}],



columns : {




defaults : {




flex : 1



},



items : [{




text : ‘名称’,



dataIndex : ‘name’



}]



}

});




User.js


Ext.define(‘V5.user.controller.User’, {




extend : ‘Ext.app.Controller’,



models : [‘V5.user.model.User’],



stores : [‘V5.user.store.Users’],



views : [‘Grid’],




refs : [{




ref:’Grid’,



selector:’userGrid’



}],



init : function() {




var me = this;



this.control({




‘button’ : {




click : me.doAction



}



});



},



doAction : function(btn) {




var me = this;




Ext.create(‘Ext.window.Window’,{




items:[{




width:500,



height:300,



xtype:’userGrid’



}]



}).show();




}

});



版权声明:本文为qq_17505335原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。