2013-06-10 3 views
0

안녕하세요 저는 Sencha 응용 프로그램에서 목록을 작성해야하며이 목록에 항목을 추가하고 싶습니다. 이 목록은 웹 서비스에서 데이터베이스 데이터를 제공합니다.프록시가있는 SenchaTouch 업데이트 목록

항목을 추가하면 데이터베이스에서 검색 할 수 있지만 목록이 새로 고침되지 않고 목록 작성 방법이 이해되지 않습니다.

누군가 나를 도울 수 있습니까? 여기

내 목록 :

여기
config: { 
      id:'Listetaches', 
      grouped:true, 
      store:'PokerStore', 
      sorters:'Tache_Libelle', 
      itemTpl:'{Tache_Libelle} <br/> Durée estimé : {Tache_Estimation} h', 

      onItemDisclosure :true   
} 

내 가게 : 내가

onAddtache: function(button, e, options) { 

    var libelle=Ext.getCmp('libelle').getValue(); 
    var description=Ext.getCmp('description').getValue(); 


    Ext.Ajax.request({ 
     url: 'Myurl', 
     method: 'POST', 
     useDefaultXhrHeader : false, 
     params: { 
      Libelle: libelle, 
      Description:description, 
     }, 
     callback: function(options, success, response) { 
      console.log(response.responseText); 
      button.up('navigationview').pop(); 

     } 

    }); 
}, 

답변

1

내가 다시 상점을 다시로드 할 생각 항목을 추가

여기
config:{ 

    model:'PlanningPoker.model.Poker', 
    autoLoad:true, 
    id:'storeList', 
    grouper: function(record){ 
     return record.get('Tache_Libelle')[0]; 
    }, 
    proxy:{ 
     type:'ajax', 
     url:'Myurl', 
     useDefaultXhrHeader : false, 
     reader:{ 
      type:'json',  
     }, 

    }, 
    autoSync: true, 
} 

내 컨트롤러 항목을 추가 한 후

1 단계 : 응용 프로그램에서 저장소는 데이터베이스의 데이터를로드합니다. (데이터는 로컬로 저장)

2 단계 : 그런 다음 데이터베이스에 새 항목을 추가 할 수 있지만 가게는 여전히 단계의 데이터 1.

하여 Ajax 요청의 콜백에 store.load()or store.sync() 추가가 있습니다

callback: function(options, success, response) { 
    console.log(response.responseText); 
    button.up('navigationview').pop(); 
    Ext.getStore('PokerStore').load(); 
}