PDA

View Full Version : Ext.append



4myGod
29 Sep 2009, 8:50 AM
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?

evant
29 Sep 2009, 8:52 AM
You specify arrays with [], not ().



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 +'\'>'}]
});

4myGod
29 Sep 2009, 8:53 AM
alright thanks.