PDA

View Full Version : Button in XTemplate is displayed only one time



myput
5 Dec 2011, 6:45 AM
Hello, i have some problems with my button in XTemplate.
Xhen i come back to my list and choose another item, the data are displayed very good, but the button in my template isn't displayed the second time ...

This is the panel:


App.views.DirectoryDetailPanelInformations = new Ext.Panel({
tpl: loadURL(App.config.host + App.config._DirectoryTPL + 'DetailPanelInformations.html'),
listeners:{
afterrender:function(){
new Ext.Button({
text: App.config._ButtonDetailDescription,
renderTo:'descriptionButtonId',
handler: function() {
Ext.dispatch({
controller: App.controllers.Directory,
action: 'buttonViewDescription',
});
}
});
}
}
});

And the template:


<tpl for=".">
<div class="DetailPanelInformations">
<div class="descriptionButtonClass" id="descriptionButtonId"></div>
<div class="information">{information}</div>
</div>
</tpl>


Have you an Idea thanks

mitchellsimoens
5 Dec 2011, 2:05 PM
That's because you are specifying the id on the div but id must be unique. So if you have 5 different divs with the same id, only one will be reported.