PDA

View Full Version : Update the content of panel when selecting a row in a grid



bozzoz
17 Oct 2010, 9:04 AM
Hello, I have a grid and a panel which displays the data of the selected row in the grid. When the selection changes I make an update of content panel with update method in this way:



gridElencoNewsSelectionIsChanged: function(sm){
//la selezione cambiata
var rec = sm.getSelected();
Ext.each([this.btDel, this.btMod], function(btn){
btn.setDisabled(!rec);
});
if (rec)
{
this.dettaglioNews.update(rec.data);
}
else
{
this.dettaglioNews.update('');
}
}

but when I change the image on a row and reload the datastore and then select the row to display details the image do not change!

The image change if I reload the application.

How to force the image refresh?

Thanks!

mcadirci
17 Oct 2010, 11:13 AM
Hello,

Did you tried setting img src with a dummy parameter? Like:
'/img/myImg.jpg?p=' + new Date().getTime()

bozzoz
17 Oct 2010, 10:26 PM
Hello Mehmet,
I tried your solution and now works perfectly.

Thank you!