PDA

View Full Version : Include list



Everio
27 Sep 2010, 8:04 AM
Hello, I have somes problems to include list into the container relation in the function buildUI:


Ext.regModel('Contact', {
fields: ['firstName', 'lastName']
});

Yoo.Home=Ext.extend(Ext.Panel,{
title:"Home",
id:"home",
layout:"fit",
initComponent:function(){
this.buildUI();
this.on("activate",function(b,a){this.get_relation()},this);
Yoo.Home.superclass.initComponent.call(this)
},
get_relation:function(){
this.relation.data={};
Ext.util.JSONP.request({
url:"http://www.***",
callbackKey:"callback",
scope:this,
callback:function(a){
this.relation.store.update(a)
},
params:{
data_method:"user"
}
})
},
buildUI:function(){
this.homeNav=new Yoo.HomeNav();
this.relation = new Ext.Container({
dock:"top",
tpl: '<tpl for="."><div class="contact"><strong>{firstName}</strong> {lastName}</div></tpl>',
itemSelector: 'div.contact',
singleSelect: true,
grouped: true,
indexBar: true,

disclosure: {
scope: 'test',
handler: function(record, btn, index) {
alert('Disclose more info for ' + record.get('firstName'));
}
},

store: new Ext.data.Store({
model: 'Contact',
sorters: 'firstName',

getGroupString : function(record) {
return record.get('firstName')[0];
}
})
});
this.dockedItems=[this.relation];
this.items=[this.homeNav]
}
});

I had success to include my list but not in a List element :


this.relation = new Ext.Container({
data:{
summit:{conditions:0}
},
tpl: '<tpl for="."><div class="contact"><strong>{firstName}</strong> {lastName}</div></tpl>'
});