PDA

View Full Version : About json



lokinfey
25 Oct 2010, 5:28 AM
I use Ext.util.JSONP.request but can not load my json data !

this is my js file . who can help me?


Ext.setup({
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: false,
onReady: function() {
var timeline = new Ext.Component({
title: '课程学习',
cls: 'timeline',
scroll: 'vertical',
tpl: [
'<tpl for=".">',
'<div>',
'<div><img src="{MobileImg}" /></div>',
'<div>',
'<h2>{Len}</h2>',
'<p>{Video}</p>',
'</div>',
'</div>',
'</tpl>'
]
});
var panel = new Ext.TabPanel({
fullscreen: true,
animation: 'slide',
items: [timeline]
});
var refresh = function() {
alert('hello');
Ext.util.JSONP.request({
url: 'http://course.gdou.com/gxk/Home/GetVideoAll',
callbackKey: 'callback',
callback: function(result) {
timeline.update(result);
}
});
};
var tabBar = panel.getTabBar();
tabBar.addDocked({
xtype: 'button',
ui: 'mask',
iconCls: 'refresh',
dock: 'right',
stretch: false,
align: 'right',
handler: refresh
});
}