Я пытаюсь заставить DataView работать (в Ext JS 2.3).
Вот jsonStore, который, кажется, работает (вызывает сервер и получает правильный ответ).
Ext.onReady(function(){
var prefStore = new Ext.data.JsonStore({
autoLoad: true, //autoload the data
url: 'getHighestUserPreferences',
baseParams:{
userId: 'andreab',
max: '50'
},
root: 'preferences',
fields: [
{name:'prefId', type: 'int'},
{name:'absInteractionScore', type:'float'}
]
});
Тогда шаблон:
var tpl = new Ext.XTemplate(
'<tpl for=".">',
'<div class="thumb-wrap" id="{name}">',
'<div class="thumb"><img src="{url}" title="{name}"></div>',
'<span class="x-editable">{shortName}</span></div>',
'</tpl>',
'<div class="x-clear"></div>'
);
Панель:
var panel = new Ext.Panel({
id:'geoPreferencesView',
frame:true,
width:600,
autoHeight:true,
collapsible:false,
layout:'fit',
title:'Geo Preferences',
И DataView
items: new Ext.DataView({
store: prefStore,
tpl: tpl,
autoHeight:true,
multiSelect: true,
overClass:'x-view-over',
itemSelector:'div.thumb-wrap',
emptyText: 'No images to display'
})
});
panel.render('extOutput');
});
На странице появляется синяя рамка с заголовком, но в ней ничего нет.
Как я могу отладить это и посмотреть, почему это не работает?
Ура,
Mulone