ishwar1979
12 Sep 2010, 10:48 PM
Hi Guys,
I am trying to populate the panel items using ajax call. It works correctly , populates all the items from ajax result. but not executing any listerner. Here is my code
function getPanel(){
var fav_tpl = new Ext.XTemplate(
'<tpl for=".">',
'<div class="resortWrap">',
'<div class="detail">',
'<h1>{name}</h1>',
'</div>',
'</tpl>'
);
var pan=new Ext.Panel({
fullscreen: true,
scroll: 'horizontal',
layout: {
type: 'hbox',
align: 'stretch'
},
tpl: fav_tpl,
baseCls: "infoWrap",
listeners: {
afterrender: function(c) {
alert('Panel afterrender');
},
afterlayout: function(c) {
lert('Panel afterlayout');
}
}
});
pan.show();
Ext.Ajax.request({
url: 'js/data.json',
method: "GET",
success: function(data){
data = Ext.util.JSON.decode(data.responseText);
pan.update(data);
}
});
}
Ext.setup({
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: false,
onReady: function() {
getPanel();
}
});
Can someone helps me to figure out what exactly I am doing wrong or what I need to do it to make these events working.
Thanks in advance.
I am trying to populate the panel items using ajax call. It works correctly , populates all the items from ajax result. but not executing any listerner. Here is my code
function getPanel(){
var fav_tpl = new Ext.XTemplate(
'<tpl for=".">',
'<div class="resortWrap">',
'<div class="detail">',
'<h1>{name}</h1>',
'</div>',
'</tpl>'
);
var pan=new Ext.Panel({
fullscreen: true,
scroll: 'horizontal',
layout: {
type: 'hbox',
align: 'stretch'
},
tpl: fav_tpl,
baseCls: "infoWrap",
listeners: {
afterrender: function(c) {
alert('Panel afterrender');
},
afterlayout: function(c) {
lert('Panel afterlayout');
}
}
});
pan.show();
Ext.Ajax.request({
url: 'js/data.json',
method: "GET",
success: function(data){
data = Ext.util.JSON.decode(data.responseText);
pan.update(data);
}
});
}
Ext.setup({
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: false,
onReady: function() {
getPanel();
}
});
Can someone helps me to figure out what exactly I am doing wrong or what I need to do it to make these events working.
Thanks in advance.