1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    29
    Vote Rating
    0
    mr.xprt is on a distinguished road

      0  

    Default extending panel and add new method

    extending panel and add new method


    hi ,

    am trying to extend Panel and add new Method to it to modify some properties of it

    my code :
    Code:
    Ext.setup({
        icon: 'icon.png',
        tabletStartupScreen: 'tablet_startup.png',
        phoneStartupScreen: 'phone_startup.png',
        glossOnIcon: false,
        //launch :function(){
    	onReady :function(){
    		var cmp = this; 
    		  
     
    		
    		MyNewPanel=Ext.extend(Ext.Panel,{
    			fullscreen:true,
    			html:'hi'
    		});
    		p=new MyNewPanel({
    
    		});
    		p.changeHtmlTo('Hi Am Changed ');
     	 }
    
    });
    so where i have to put the defination of the new method
    Code:
    function changeHtmlTo(html){
    MyNewPanel.update(MyNewPanel);
    }
    it's not about changing the panel's html but the method is only for example

    thanks
    Still Learning .... Still Expert

  2. #2
    Sencha User
    Join Date
    Apr 2011
    Location
    Brittany, France
    Posts
    82
    Vote Rating
    0
    jmclem is on a distinguished road

      0  

    Default


    Hi,

    here:
    Code:
    MyNewPanel=Ext.extend(Ext.Panel,{
        fullscreen:true, 			
        html:'hi',
        changeHtmlTo: function (h) {
            //do whatever you want
        }
    });
    Jean-Marie.

  3. #3
    Sencha User
    Join Date
    Feb 2011
    Posts
    29
    Vote Rating
    0
    mr.xprt is on a distinguished road

      0  

    Default


    thanks alot
    Still Learning .... Still Expert

  4. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    49
    Vote Rating
    2
    nish1013 is on a distinguished road

      0  

    Default


    Quote Originally Posted by jmclem View Post
    Hi,

    here:
    Code:
    MyNewPanel=Ext.extend(Ext.Panel,{
        fullscreen:true,             
        html:'hi',
        changeHtmlTo: function (h) {
            //do whatever you want
        }
    });
    Jean-Marie.
    Cheers Jean , help for me too

Thread Participants: 2