2012-07-31 3 views

답변

1

나는 Treegrid afetr을 검색 필드 (URL에서 이것을 전달해야 함)에서 검색하려고 시도하는 동안 이상한 동작을 발견했습니다. 논리

어떻게 여기에 생성됩니다

  1. 만든 rootVisible의와 나무 클래스 : 거짓과 가기 :의 mystore
  2. 내 상점은 프록시를 {} 내가 컨트롤러
  3. 에서 동적으로 설정했다대로이 없습니다 매장 자동로드 내부
  4. : 거짓이었다가
  5. 중고 mystore.load() 트리

요청에 데이터를로드 할 수 2 회 간다 루트 노드가 없어도 트리의 빈 루트 노드.

다음과 같은 방법으로 해결했습니다 ... 와트 확장이 확실하지 않은 것은 정확합니다. 더 나은 솔루션은 컨트롤러

search: function(button){ 

      var searchText = this.getSearchField().value; 


      //created a store instance 

      var mystore = Ext.data.StoreManager.lookup('MyTreeStore'); 

      mystore.setProxy({ 
           type: 'ajax', 
           url: 'app/searchid/'+searchText; 
          }); 


      var mytree = Ext.create('AM.view.MyTree',{store:mystore}); 

      Ext.getCmp('tn').add(mytree); 

      //DON’T USE store.load() method As we have set rootVisible: false so it will automatically try to load the store or will send the request 

}

저장 파일

  Ext.define('AM.store.BomTreeStore', { 

       extend: 'Ext.data.TreeStore', 

       model: 'AM.model.BomTree', 

       autoLoad: false, 

       folderSort: true 
      }); 

이에 대한 모든 더 나은 솔루션 내부

트리 클래스 (보기)

  Didn’t define any treestore inside tree view 
      rootVisible: false 

을 공유하십시오 PLZ 토끼 :

관련 문제