1. #1
    Ext User
    Join Date
    Sep 2009
    Posts
    28
    Vote Rating
    0
    4myGod is on a distinguished road

      0  

    Default Ext.append

    Ext.append


    Ext.DomHelper.append('player-list', {tag: 'tr', cls: 'player', children: ({tag: 'td', cls: 'status ' + status}, {tag: 'td', cls: 'rank', html: '<img src=\''+ webRoot +'image/rank/'+ players[plyr].rank +'.png\' alt=\''+ players[plyr].rankName +'\'>'})
    });

    Obviously I am screwing this up pretty hardcore, however I am trying to add multiple children at once. Can someone please tell me the correct way?

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,645
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    You specify arrays with [], not ().

    Code:
    Ext.DomHelper.append('player-list', {tag: 'tr', cls: 'player', children: [{tag: 'td', cls: 'status ' + status}, {tag: 'td', cls: 'rank', html: '<img src=\''+ webRoot +'image/rank/'+ players[plyr].rank +'.png\' alt=\''+ players[plyr].rankName +'\'>'}]
    });
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext User
    Join Date
    Sep 2009
    Posts
    28
    Vote Rating
    0
    4myGod is on a distinguished road

      0  

    Default


    alright thanks.

Thread Participants: 1