PDA

View Full Version : Dataview refresh problem



Hollywood
29 Jan 2010, 2:33 AM
Hey Guys,

I have a dataview which is loaded whenever someone clicks on a row in my grid,after which a user may fill a form and update the data, NOW again when he clicks on the grid and the store is loaded , the values in the dataview are the old values and not the new updated ones. even though the JSON returned shows the correct values the dataview does not until i refresh the page. any suggestions to this problem?

code is given below for review:



if(...){
var vdtpl = new Ext.XTemplate(
'<tpl for=".">',
'<div><table class="table">',
'<tr><td class="td" colspan="2">Violation Dispute is pending processing </td></tr>',
'<tr class="tr"><td class="slate-td">Dispute Justification</td><td class="slate-td"> {disjust}</td></tr>',
'<tr><td class="td">Approver:</td><td class="td"> N/A </td></tr>',
'<tr class="tr"><td class="slate-td">Dispute Approver Comments:</td><td class="slate-td"> N/A </td></tr>',
'</table></div>',
'</tpl>'
);
}
else if(...)
{
vdtpl = something else;
}
var tab1 = kir.tab.getComponent('vdTab');
if(!tab1 && (record.data.vdispute == "Yes" || record.data.vdispute == "yes") && record.data.amnesty != "Yes")
{
tab1 = kir.tab.add({
itemId: 'vdTab',
autoScroll:true,
title:'Dispute',
items: new Ext.DataView({
store: kir.store.allstore,
tpl: vdtpl,
autoHeight: true,
multiSelect: true,
overClass: 'x-view-over',
itemSelector: 'td.td'
})
});
}
kir.store.allstore.load();
kir.store.allstore.removeAll(); // even without this i face the same problem


someone suggested refreshing the dataview , but i get
el is undefined
el.update("")whenever i name the dataview and then do



kir.MyView = new Ext.DataView({
store: kir.store.allstore,
tpl: vdtpl,
autoHeight: true,
multiSelect: true,
overClass: 'x-view-over',
itemSelector: 'td.td'
})
kir.store.allstore.load();
MyView.refresh();