2012-01-10 9 views
1
I am unable to load the below xml in to List using Sencha. 

<?xml version="1.0" encoding="UTF-8"?> 
<bdayevents> 
<bdayevent>Acceptance Letters</bdayevent> 
<bdayevent>Acceptance Letters</bdayevent> 
</bdayevents> 

This is the model which i am trying to use as there are no attributes to my XML. 

Ext.regModel('BEvent',{name:'bdayevent'}); 
var store = new Ext.data.Store({ model: 'BEvent', 
proxy: { 
type: 'ajax', 
url: 'http://localhost:8080/JSON/BirthdayInvitations.xml', 
reader: { 
type : 'xml', 
root : 'bdayevents', 
model : 'BEvent', 
record : 'bdayevent' 
} 
} 


}); 

これは準備中に呼び出すためのリストです。Senchaを使用してXMLからリストにデータを読み込むことができません

上記のスニペットの結果は、インデックスを表示する空のページです。

この問題を解決するのに手伝ってください。

おかげで、 シャム

答えて

0

この

Ext.regModel('BEvent', { 
     fields: ['bdayevent'] 
    }); 
    var store = new Ext.data.Store({ 
     model: 'BEvent', 
     method:'get', 
     proxy: { 
      type: 'ajax', 
      url : 'BirthdayInvitations.xml', 
      //url: 'test1.xml', 
      reader: { 
       type : 'xml', 
       record: 'bdayevents' 
      } 
     }, 
     autoLoad: true 
    }); 
    var XMLTpl = new Ext.XTemplate(
     '<tpl for=".">', 
      '<div>{bdayevent}', 
     '</tpl>' 
    ); 
    var list = Ext.create('Ext.List', { 
     fullscreen: true, 
     store: store, 
     onItemDisclosure: {}, 
     itemTpl: XMLTpl 
    }); 
を試してみてください
関連する問題