im using a AJAX request to get value from the server in a JSON format. but when i try to show this in the Ext.List only 1 value shows up instead of all.
Ext.setup({
onReady: function() {
Ext.regModel( Contact , {
fields: [ firstName , lastName ]
iii
var posts;
var count;
var name = sdf ;
Ext.Ajax.request({
url: a.php/pool/listPools ,
method: post ,
type: json ,
success: function(response){
posts = Ext.decode(response.responseText);
alert(response.responseText);
count = posts.count;
for (var i = 0; i < count; i++) {
name = posts.data[i].name;
alert(name);
var btnContact = new Ext.TabPanel({
fullscreen: true,
items: [ new Ext.List({
itemTpl: ,
title: My Tab ,
tpl: <tpl for="."><div class="contact"><strong>{firstName}</strong> {lastName}</div></tpl> ,
itemSelector: div.contact ,
singleSelect: true,
grouped: true,
indexBar: false,
store: new Ext.data.JsonStore({
model: Contact ,
sorters: firstName ,
getGroupString: function (record) {
return record.get( firstName );
},
data: [
{
firstName: name,
lastName:
}
]
})
}),
//{ title: Tab 2 }
]
iii
}}
iii
}
iii
我的问题是,如何显示所有检索的数据? 而不是仅仅1?