Results 1 to 4 of 4

Thread: BasicDialog

  1. #1
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,408

    Default BasicDialog

    Since there is no BasicDialog in Ext2, I started by using this while updating our code. It is barebones at the moment, but hopefully someone else can help fill it in...

    Code:
    Ext.BasicDialogTabs = Ext.extend(Ext.TabPanel,{
    	defaults:{bodyStyle:'padding:18px;'},
    	
    	readTabs : function(removeExisting)
    	{
    	    if(removeExisting === true){
    	        this.items.each(function(item){
    	            this.remove(item);
    	        }, this);
    	    }
    	    var tabs = this.el.query(this.autoTabSelector);
    	    for(var i = 0, len = tabs.length; i < len; i++){
    	        var tab = tabs[i];
    	        var title = tab.getAttribute('title');
    	        tab.removeAttribute('title');
    	        var id = tab.getAttribute('id')+'_tab';
    	        this.add({
    	        	id: id,
    	            title: title,
    	            contentEl: tab
    	        });
    	    }
    	},
    	hideTab: function(id)
    	{
    		this.hideTabStripItem(id+'_tab');
    	},
    	unhideTab: function(id)
    	{
    		this.unhideTabStripItem(id+'_tab');
    	},
    	enableTab: function(id)
    	{
    		this.getTab(id).disable(false);
    	},
    	disableTab: function(id)
    	{
    		this.getTab(id).disable();
    	},
    	activateTab: function(id)
    	{
    		this.setActiveTab(id+'_tab');
    	},
    	getTab:function(id)
    	{
    		return this.items.get(id+'_tab');
    	}
    	
    });
    
    Ext.BasicDialog = Ext.extend(Ext.Window,{
    	closeAction: 'hide',
    	hideBorders: true,
    	bodyStyle:'padding-top:10px',
    	initComponent : function()
    	{
    		if (this.autoTabs)
    		{
    			this.tabs=new Ext.BasicDialogTabs({
    				deferredRender: false,
    				autoTabs:	this.autoTabs,
    				activeTab:0,
    				el:this.tabsEl
    			});
    			this.items=[this.tabs];
    			this.layout='fit';
    		}
    		Ext.BasicDialog.superclass.initComponent.call(this);
    	},
    	
    	getTabs:function()
    	{
    		return this.tabs;
    	},
    	getTab:function(id)
    	{
    		return this.tabs.getTab(id);
    	}
    });

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956

    Default

    Thanks Steve. That will be really useful for many people who are upgrading!
    Jack Slocum
    Sencha Co-Founder, Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum

  3. #3

    Default

    Can you give any example, how to use this? I am new to Extjs.

    Thanks

  4. #4
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,408

    Default

    Quote Originally Posted by litumishra View Post
    Can you give any example, how to use this? I am new to Extjs.

    Thanks
    It is not for you then. It is a class to help people port from Ext 1.x to Ext 2.x

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •