0

我有两个面板。当我单击左侧面板项目时,其调用 Web 服务并填充右侧面板,同时将右侧面板中的项目数更新为单击的左侧面板项目。第一次更新左侧面板项目,但是当我单击另一个左侧面板项目时,它不会再次更新左侧面板项目。它只是第一次更新。

我的代码是:

   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 componenet queueDetails list
    var inboxWorkitemList = Ext.getCmp('inboxWorkitemList'); 
    var queueDetails = Ext.getCmp('queueDetails');
    var queueList = Ext.getCmp('queuelist');                  //Getting component list
    var queueViewPanel = Ext.getCmp('queueViewPanel');        //Getting queueViewPanel
    queueDetails.setStore(store);
      store.sync();
    var queueCount = store.getCount();                        
    if (queueCount > 0) {
        var queueItem = store.getAt(0);
        var queueStore = queueList.getStore();
              queueStore.each(function (record) {
               if (record.get('workSetName') == queueItem.get('sourceWorkstep')) {
                record.data.queueName = queueItem.get('sourceWorkstep') + '(' +   
                queueCount + ')';

            }
        });

         queueList.setStore(queueStore);
        queueStore.sync();
        queueList.getStore().each(function (record) {
            console.log('queueList:' + record.data.queueName);
        });
      console.log('store UPDATED');
    }
    queueList.refresh();
    console.log('store count: ' + store.getCount());
    console.log(queueDetails);
    // navigates the panel
    queueViewPanel.animateActiveItem(
        inboxWorkitemList, {
            type:'slide',
            direction:'up',
            duration:250
        });

},

请在这个问题上帮助我。

4

1 回答 1

0

我必须为此设置记录,我解决它。

  queueStore.each(function (record) {
               if (record.get('workSetName') == workitem.get('sourceWorkset')) {
                record.data.queueName = workitem.get('sourceWorkset')
                    + '(' + queueCount + ')';
                // queueStore.updateRecord(record.data.queueName);
                record.set(record.data.queueName);
            }
        });
于 2012-06-21T10:46:39.670 回答