PDA

View Full Version : display and update an image in Grid panel



anandan
4 Mar 2010, 7:15 PM
Hi,

I am trying to display an image in a grid panel and keep updating it.
When i change a data, the image is modified. Changing data is working fine. Problem is old image is not replaced by the modified one. It just displays another new image on screen. So, i am getting new image in the screen for every update/refresh cycle.

Here is the code:

data: sampleData
,dataRoot: 'img'
,dataIdField: 'name'
,dataFields: [
{name: 'name'}
]
,id: 'root'
,columns: [
{
header: "Image", width: 100
,renderer: function(value) {
return img_url;
}
,dataIndex: 'name', sortable: true
}

Regards,
Anandan

Animal
5 Mar 2010, 12:19 AM
Try appending



"?" + new Date().getTime()


To the URL. If the browser has already downloaded an image of that URL, then it's not going to do it again, so you have to make the URL unique.

anandan
5 Mar 2010, 4:43 AM
Hi,
@Animal. thanks for replying back.
I got it resolved myself.
I used an event called "datachanged" which helped me to resolve this problem.