-
Unanswered: Sencha to Analytic XML,Not display ,why?
Unanswered: Sencha to Analytic XML,Not display ,why?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>test rss</title>
<link rel="stylesheet" href="sencha/resources/css/sencha-touch.css" type="text/css">
<link rel="stylesheet" href="sencha/examples/guide/css/guide.css" type="text/css">
<script type="text/javascript" src="sencha/sencha-touch-debug.js"></script>
<script type="text/javascript">
Ext.setup({
onReady: function(){
Ext.regModel('law',{idProperty: 'id', fields: [{name:'title',type:'string'},{name:'Content',type:'string'}]});
var xmlStore = new Ext.data.Store({
model: 'law',
method: 'GET',
proxy: {
url: 'http://localhost:7529/law/2.xml',
type: 'ajax',
reader: {
type: 'xml',
record: 'Item',
root: 'list'
}
}
});
xmlStore.load();
var xmlList = new Ext.List({
title: 'xmlList',
fullscreen: true,
itemTpl: '<tpl for=".">{values.data.customerPk} - {id}</tpl>',
store: xmlStore
});
var p = new Ext.TabPanel({
fullscreen: 'true',
items: [xmlList]
})
}
});
</script>
</head>
<body>
</body>
</html>
xml:
<?xml version="1.0" encoding="utf-8" ?>
<law>
<Item>
<id>1</id>
<title> 1 </title>
<Content> 1 </Content>
</Item>
<Item>
<id>2</id>
<title> 2 </title>
<Content> 2 </Content>
</Item>
<Item>
<id>3</id>
<title> 3</title>
<Content>3 </Content>
</Item>
<Item>
<id>4</id>
<title> 4</title>
<Content>4 </Content>
</Item>
<Item>
<id>5</id>
<title> 5</title>
<Content>5 </Content>
</Item>
<Item>
<id>6</id>
<title> 6</title>
<Content>6 </Content>
</Item>
</law>
: - ?
-
Sencha - Senior Forum Manager
Please edit your post and add in the code tags.
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us