1. #1
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    574
    Vote Rating
    31
    Kurt001 has a spectacular aura about Kurt001 has a spectacular aura about

      0  

    Default [SOLVED] Understanding Namespace and Ext.regApplication

    [SOLVED] Understanding Namespace and Ext.regApplication


    Hi there,

    I am having two *.js files.
    1) index.js, which holds
    PHP Code:
    Ext.regApplication({
        
    name'dropMe',
        
    launch: function() {

            var 
    board = new Ext.Panel
                
    ({
                    
    layout"card",
                    
    items: [],
                    
    dockedItems: [],
                });
    var 
    myBoardFiller = new fillBoard();
            
    myBoardFiller.doTheFill();

    2) helper.js which holds:

    PHP Code:
    function fillBoard(){
        
    this.doTheFill = function(){
            var 
    myText = new Ext.form.Text();
            
    myText = {
                
    name'textName',
                
    label:'textLabel'
            
    }
            
    dropMe.board.add(myText);
        }

    But it reports back that dropMe.board is not an object.
    Whats wrong?

    Best TD

  2. #2
    Sencha User
    Join Date
    Feb 2009
    Location
    Glasgow, Scotland
    Posts
    293
    Vote Rating
    5
    Stuart-SwarmOnline will become famous soon enough

      0  

    Default


    Instead of defining 'board' as a local variable you will need to define it as a property of the dropMe namespace object. So instead of "var board = ..." change it to "dropMe.board = ..."

  3. #3
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    574
    Vote Rating
    31
    Kurt001 has a spectacular aura about Kurt001 has a spectacular aura about

      0  

    Default Thanks works, but update does not work

    Thanks works, but update does not work


    Hi,
    now I changed it like this:

    PHP Code:
    function fillBoard(){
        
    this.doTheFill = function(){
            var 
    myText = new Ext.form.Text();
            
    myText = {
                
    style"background-color:green;",
                
    name'textName',
                
    label:'textLabel'
            
    }
            
    dropMe.board.add(myText);
            
    dropMe.board.update();
        }
    }


    Ext.regApplication({
        
    name'dropMe',
        
    launch: function() {
            
            
    dropMe.board = new Ext.Panel({
                
    fullscreentrue,
                
    style"background-color:#dadee2;",
                
    layout"card"
            
    });
            
            var 
    myBoardFiller = new fillBoard();
            
    myBoardFiller.doTheFill();
        }
    }) 
    But update does not work. If I change the size of Safari, it shows up.
    What is wrong here?

    Best TD

  4. #4
    Sencha User
    Join Date
    Feb 2009
    Location
    Glasgow, Scotland
    Posts
    293
    Vote Rating
    5
    Stuart-SwarmOnline will become famous soon enough

      0  

    Default


    Replace "dropMe.board.update();" with "dropMe.board.doLayout()"

  5. #5
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    574
    Vote Rating
    31
    Kurt001 has a spectacular aura about Kurt001 has a spectacular aura about

      0  

    Default thanks again

    thanks again


    Great, thanks.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi