PDA

View Full Version : panel not getting updated with store values



khushkedia
11 Jun 2012, 6:02 AM
Hi,

I am creating a page with 2 panel. Right Panel and Left panel. I am calling webservices to get the content on the right panel and updating it on the left panel.When i delete a content from the left panel, it affects the right panel. The webservice is called again and the store is updated. I can see the updated values in the store but its not reflected in my right panel.


onInboxListTap:function (dataview, index, item, record) {
console.log('Inside onInboxListTap function');
var queuestore = dataview.getStore();
var rec = queuestore.getAt(index);
console.log(rec.data.workSetName);
var store = Ext.getStore('InboxWorkitemStore');
store.clearData(); //Function To clear WorkitemStore
//creating object of InboxQueueServices class
var inboxQueueServiceObject = Ext.create('InfoImage.common.services.InboxQueueServices', {
config:{
scope:this

}
}, this.onQueueContentRetrievalSuccess, this.onQueueContentRetrievalFailure());
// calling loadQueueContent function to load queue contents
inboxQueueServiceObject.loadQueueContent(rec.data.workSetName);


},
//To call Function onQueueContentRetrievalSuccess after loadQueueContent successful
onQueueContentRetrievalSuccess:function () {

console.log('Inside onQueueContent Retrieval Success function');

var store = Ext.getStore('InboxWorkitemStore'); //Getting WorkitemStore
//Getting componenet queueDetails list
var inboxWorkitemList = Ext.getCmp('inboxWorkitemList'); //Getting inboxWorkitemList panel
var queueDetails = Ext.getCmp('queueDetails');
var queueList = Ext.getCmp('queuelist'); //Getting componenet queuelist
var queueViewPanel = Ext.getCmp('queueViewPanel'); //Getting queueViewPanel
queueDetails.setStore(store); //Setting WorkitemStore to list queueDetails
var queueCount = store.getCount(); //Counting number of records in the WorkitemStore
if (queueCount > 0) {
var queueItem = store.getAt(0);
//var queueStore = queueList.getStore();
var queueStore = Ext.getStore('QueueStore');
//Setting QueueStore to list QueueList
queueStore.each(function (record) {
if (record.get('workSetName') == queueItem.get('sourceWorkstep')) {
console.log('inside of adding badge');
console.log('queuename:' + record.data.queueName);
//record.data.queueName = queueItem.get('sourceWorkstep') + '<span class="x-badge">(' + queueCount + ')</span>';
record.data.queueName = queueItem.get('sourceWorkstep') + '(' + queueCount + ')';
//console.log('queuename:' + record.data.queueName);
//queueStore.clearData();
}
});
console.log('Setting store');
queueList.setStore(queueStore);
console.log(' queueList:'+queueList);
queueStore.sync();
queueList.getStore().each(function (record) {
console.log('queueList:' + record.data.queueName);
});
console.log('store UPDATED');

}
console.log('store count: '+store.getCount());
console.log(queueDetails);
// navigates the panel
queueViewPanel.animateActiveItem(
inboxWorkitemList, {
type:'slide',
direction:'up',
duration:250
});

console.log('navigation happens');

},
onQueueContentRetrievalFailure:function () {
console.log('Inside onQueueContentRetrievalFailure function');

},

khushkedia
13 Jun 2012, 12:17 AM
Can someone please take a look at this?

scottmartin
21 Jun 2012, 10:16 AM
You are not provide much information to go on for your setup?

Are these forms on each panel? Or are they grids?
Have you tried using form.loadRecord(record) for the 2nd form?

Regards,
Scott.