继承 tabpanel 对父类重新赋值 父类方法重写

 
 
 
 
 
 
 
================================
写一个函数,里面定义一个win嵌套一个TabPanel
TabPanel根据重新赋值。
===============================
    var del =new TempViewPanel();
    var delstore = del.gridPanel.getStore();
    Ext.apply(delstore.baseParams,{
        limit:20,
        type : 4,
        start :0
    });
    delstore.reload(delstore.baseParams);
 
    var tabPanel=new Ext.TabPanel(
            {
                width:300,
                height:300,
                activeTab: 0,
                //autoHeight: true,
                items:[{
                      title: '充值类',
                      items: pay
                    },
================================
后期方法重写并加载 实现tbar隐藏掉
===============================
  afterRender : function(){        
        TempViewPanel.superclass.afterRender.call(this);
        this.gridPanel.on('afterrender',function(grid){
            grid.tbar.dom.style.display = 'none';
            grid.doLayout();
        },this);
    },
================================
Tbar 上的按钮
===============================
this.toolbar = [{
id: 'pay_inter',
text: '充值类',
iconCls: 'add',
handler: this.pay_inter,
scope: this //将自己传了过去
}];
//当前面板下写的tbar 
pay_inter:function(){
    var store = this.gridPanel.getStore();
    var lastOptions = store.lastOptions;
    lastOptions.params.type = 0;  //直接强制性赋值
    store.reload(lastOptions);   // reload  load 
},
 
 
 
================================
实现了后期赋值并加载
===============================
 
 afterRender : function(){ //加载完后执行
        InterFacePanel.superclass.afterRender.call(this); //取得父类对象 InterFacePanel为子类继续的对象
        var params = this.store.baseParams; //找到待修改的对象 
        Ext.apply(params,{ //赋值属性
            start : 0,
            limit :20            
        })
        this.store.load(params); //手工加载    
    },
 
================================
以下不太规范
===============================
var pay =new TempViewPanel;
var check =new TempViewPanel;
var update =new TempViewPanel;
var modify =new TempViewPanel;
var del =new TempViewPanel;
lastOptions = pay.gridPanel.getStore().lastOptions.params.type = 0;
pay.gridPanel.getStore().reload(lastOptions);
lastOptions = check.gridPanel.getStore().lastOptions.params.type = 1;
check.gridPanel.getStore().reload(lastOptions);
lastOptions = update.gridPanel.getStore().lastOptions.params.type = 2;
update.gridPanel.getStore().reload(lastOptions);
lastOptions = modify.gridPanel.getStore().lastOptions.params.type = 3;
modify.gridPanel.getStore().reload(lastOptions);
lastOptions = del.gridPanel.getStore().lastOptions.params.type = 4;
del.gridPanel.getStore().reload(lastOptions);
posted @ 2012-06-26 10:16  holyes  阅读(304)  评论(0编辑  收藏  举报