Extjs4 MVC 示例
或多或少的参照了官方的一些代码
已完成的功能:
布局分成 上 中 下 ,
在框架加载后就设置默认面板,
完成了左树、带grid的tabpanel并实现了分页及查询,
具体例子去下面地址下载吧
功能的入口点是:底部的“政府信息公开”按钮
注:这只是一个框架,里面具体逻辑实现是由你们自己展现,里面该访问url的地方都用jsp来返回,具体要怎样返回值是由你们自己的需求定的。
工程是 MyEclipse 5.5 +
代码写的不够规范 建议去一些论坛查找相应教学视频 毕竟第一次接触Extjs是 E4版本的
下载地址1:http://download.csdn.net/detail/psbye/3747607
下载地址2:http://download.csdn.net/detail/psbye/3746910
//初始化框架UI initFrameUI:function(){ //添加头部导航 //添加中间欢迎面板 this.getFrame().getComponent('frame_center').add(Ext.create('Ext.panel.Panel',{title:'欢迎页面'})); //添加底部工具面板 this.getFrame().getComponent('frame_south').add(Ext.create('Evecms.view.frame.FootBar',{id:'frame_footbar'})); }, //初始化框架UI initFrameUI:function(){ //添加头部导航 //添加中间欢迎面板 this.getFrame().getComponent('frame_center').add(Ext.create('Ext.panel.Panel',{title:'欢迎页面'})); //添加底部工具面板 this.getFrame().getComponent('frame_south').add(Ext.create('Evecms.view.frame.FootBar',{id:'frame_footbar'})); },
兄弟你认真检查一下,因为在view.frame.Frame定义了alias:'widget.frame',这样你的应用就多了frame这种xtype,再在controller.frame.FrameControl定义了refs: [{ref: 'frame',selector: 'frame'}],这样就有了FrameControl就有了getFrame()方法。你下载4.1beta2版看Ext.app.Controller类就看到有refs这个config了,4.0.7版的api都没有看到有这个config //初始化框架UI initFrameUI:function(){ //添加头部导航 //添加中间欢迎面板 this.getFrame().getComponent('frame_center').add(Ext.create('Ext.panel.Panel',{title:'欢迎页面'})); //添加底部工具面板 this.getFrame().getComponent('frame_south').add(Ext.create('Evecms.view.frame.FootBar',{id:'frame_footbar'})); },
由于Extjs4刚出来没多久 公司怕会有一定风险,所以现在不用extjs4 改为3.4版本的
你这个问题现在不好判断 //初始化框架UI initFrameUI:function(){ //添加头部导航 //添加中间欢迎面板 this.getFrame().getComponent('frame_center').add(Ext.create('Ext.panel.Panel',{title:'欢迎页面'})); //添加底部工具面板 this.getFrame().getComponent('frame_south').add(Ext.create('Evecms.view.frame.FootBar',{id:'frame_footbar'})); },
兄弟你认真检查一下,因为在view.frame.Frame定义了alias:'widget.frame',这样你的应用就多了frame这种xtype,再在controller.frame.FrameControl定义了refs: [{ref: 'frame',selector: 'frame'}],这样就有了FrameControl就有了getFrame()方法。你下载4.1beta2版看Ext.app.Controller类就看到有refs这个config了,4.0.7版的api都没有看到有这个config
谢谢提出问题!因为这个是刚刚接触E4的 很多地方写法都不规范 都在摸索中,再加上公司怕有一定风险,现在改为3.4的弄 E4只能等有时间了再研究了