2011-05-09 3 views
1

임 데이터 트리를로드하려고하지만 난이의 ExtJS 오류 : 어떤 방법 'loadData'

function ReadTree() { 
     try { 
      objHandler.ReadAssets(function (serverResponse) { 
       if (serverResponse.error == null) { 
        var result = serverResponse.result; 
        if (result.length > 2) { 

         treestore.loadData(Ext.decode(result)); 

         } 
       } 
       else { 
        alert(serverResponse.error.message); 
       } 
      }); //eo serverResponse 
     } //eo try 
     catch (e) { 
      alert(e.message); 
     } 
    } 
+0

treestore는 어디에 정의되어 있습니까? – McStretch

+0

바로 VAR의 treestore = Ext.data.TreeStore 전에 새로운 ({ 필드 : '제목', 'IpAdress', '설명', 데이터 [] }); – Armance

답변

1

TreeStore는 Ext.data.Store 따라서 상속하지 않습니다 내 코드입니다

Uncaught TypeError: Object [object Object] has no method 'loadData' 

이 오류를 얻을 loadData 메소드가 없습니다. TreeStore 및 Store는 모두 Ext.data.AbstractStore에서 상속받으며 load 메서드 만 정의합니다. 따라서 TreeStore에는로드 메서드가 있으므로 대신 사용해야 할 것입니다.

+0

고맙습니다. 더 이상 오류가 없습니다.하지만 모든 데이터가로드되어 있지 않습니다. ( – Armance

+0

@astrocybernaute - TreeStore의로드가 구성된 모든 프록시를 사용하기 때문에 스토어에서 프록시를 설정해야합니다. : http://dev.sencha.com/deploy/ext-4.0.0/docs/api/Ext.data.proxy.Proxy.html – McStretch

+0

ok 고마워,하지만 이걸로 시작하면, plz가 나를 가리킬거야. 나를 도울 수있는 예제로 .. 감사합니다 – Armance