Ext.ns('Ext.ux');

 function btn(){
alert(this.id);
};
var panel_plugs = {//定义插件
init : function(panel){
panel.width = 600;
panel.height = 300;
panel.title = '测试';
panel.tools = [{id:"maximize ",handler:btn},{id:"minimize ",handler:btn},{id:"close ",handler:btn}];
}
};

方法一:

 Ext.MyPanel = function(){
//Ext.MyPanel.superclass.initComponent.call(this);
Ext.MyPanel.superclass.constructor.call(this,{
id : 'div_ext',
title : 'ceshi',
width : 600,
height : 300,
renderTo : 'div1',
tbar : [{text:"1"},{text:"2"},{text:"3"}]
})
};
Ext.extend(Ext.MyPanel,Ext.Panel,{
plugins : panel_plugs
});

方法二:

1 Ext.MyPanel = Ext.extend(Ext.Panel,{

         id : 'div_ext',
title : 'ceshi',
width : 600,
height : 300,
renderTo : 'div1',
tbar : [{text:"1"},{text:"2"},{text:"3"}], plugins : panel_plugs
// constructor : function(){
// Ext.MyPanel.superclass.constructor.call(this);
// },
// initComponent : function(){
// Ext.MyPanel.superclass.initComponent.call(this);
// }
});

运行代码:

 Ext.reg('mypanel',Ext.MyPanel);

 Ext.onReady(function(){
new Ext.MyPanel();
})

结果图:

最新文章

  1. Android Conflict with nineoldandroids等报错
  2. 高性能javascript(记录二)
  3. A multi-faceted language for the Java platform
  4. PHP爬虫(2)DOM处理
  5. BZOJ 2005: [Noi2010]能量采集
  6. PHP站内搜索、多关键字、加亮显示
  7. 理解assign,copy,retain变strong
  8. Android平台二维码之生成,扫描 & 识别
  9. [MetaHook] R_RicochetSprite
  10. 【Valid Palindrome】cpp
  11. .Net学习难点讨论系列17 - 线程本地变量的使用
  12. 读书笔记之_Win10 与Jmeter5.1.1界面兼容:
  13. excel身份证验证(附带防止粘贴导致校验失效的函数)
  14. DWM1000 测距原理简单分析 之 SS-TWR
  15. springMVC(五): 通过 HandlerMapping 获取 HandlerExecutionChain
  16. No setter found for property 'cronExpression' in class 'org.springframework.scheduling.quartz.CronTriggerBean'
  17. 2018.10.18 NOIP训练 [SCOI2018]Pipi 酱的日常(线段树)
  18. ASP.NET MVC 5使用Filter过滤Action参数防止sql注入,让你代码安全简洁
  19. 有趣的 Mysql 存储引擎
  20. 获取项目路径js

热门文章

  1. POI 操作(新接口)
  2. 《深入Java虚拟机学习笔记》- 第17章 异常
  3. selenium IDE & Remote Control & Webdriver
  4. MSP430F5438点亮led
  5. 书签小助手V1.1发布了
  6. Spring 拦截器配置
  7. NOIP2004 津津的储蓄计划
  8. 深入浅出 JavaScript 变量、作用域和内存 v 0.5
  9. Web技术导论复习大纲
  10. 关于java对象的思考