Results 1 to 3 of 3

Thread: Ext.append

  1. #1
    Ext User
    Join Date
    Sep 2009
    Posts
    28
    Vote Rating
    0
      0  

    Default 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
    18,377
    Vote Rating
    858
      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
      0  

    Default

    alright thanks.

Posting Permissions

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