J'essaie de faire un travail DataView (sur Ext JS 2.3).Ext.data.JsonStore + Ext.DataView = ne pas charger les enregistrements
Voici le jsonStore, qui semble fonctionner (il appelle le serveur et obtient une réponse valide).
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'}
]
});
Puis le XTemplate:
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>'
);
Le panneau:
var panel = new Ext.Panel({
id:'geoPreferencesView',
frame:true,
width:600,
autoHeight:true,
collapsible:false,
layout:'fit',
title:'Geo Preferences',
Et le 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');
});
Ce que je reçois dans la page est un cadre bleu avec le titre, mais rien dedans. Comment est-ce que je peux déboguer ceci et voir pourquoi cela ne fonctionne pas?
Cheers, Mulone
Bravo! ça a marché. – Mulone