PDA

View Full Version : Problems with two dataviews



manuito
10 Feb 2010, 1:25 AM
I have two dataviews:


var dataviewON = new Ext.DataView({
id:'dataviewON',
tpl: tpl,
autoHeight:true,
multiSelect: true,
overClass:'x-view-over',
itemSelector:'div.thumb-wrap',
emptyText: 'No images to display',

plugins: [
new Ext.DataView.DragSelector(),
new Ext.DataView.LabelEditor({dataIndex: 'name'})
],

prepareData: function(data){
data.shortName = Ext.util.Format.ellipsis(data.name, 15);
return data;
},

listeners: {
selectionchange: {
fn: function(dv,nodes){
var l = nodes.length;
var s = l != 1 ? 's' : '';
panel.setTitle('Encender/Apagar Equipos Aula ('+l+' alumno'+s+' seleccionado'+s+')');
}
}
}
});

var dataviewNet = new Ext.DataView({
id:'dataviewNet',
tpl: tpl,
autoHeight:true,
multiSelect: true,
overClass:'x-view-over',
itemSelector:'div.thumb-wrap',
emptyText: 'No images to display',

plugins: [
new Ext.DataView.DragSelector(),
new Ext.DataView.LabelEditor({dataIndex: 'name'})
],

prepareData: function(data){
data.shortName = Ext.util.Format.ellipsis(data.name, 15);
return data;
},

listeners: {
selectionchange: {
fn: function(dv,nodes){
var l = nodes.length;
var s = l != 1 ? 's' : '';
panel2.setTitle('Habilitar/Deshabilitar Internet ('+l+' alumno'+s+' seleccionado'+s+')');
}
}
}
});when I insert this data:


var myStore = new Ext.data.JsonStore({
data: alumnos,
root: 'images',
fields: ['name','url','pcname']
});

dataviewON.setStore(myStore);
dataviewNet.setStore(myStore);I found this error:

b is undefined
DomHelper( )ext-all.js (línea 7)
DomHelper() ext-all.js (línea 7)
pintarDataView() conexion.js (línea 142)
pintarEquiposAula() conexion.js (línea 125)
success() conexion.js (línea 77)
DomHelper() ext-all.js (línea 7)
f() ext-base.js (línea 7)
apply() ext-base.js (línea 7)

Ext.DomHelper=function(){var t=null,k=...lclick",this.onNodeDblClick,this)}});

Thanks.

manuito
11 Feb 2010, 6:23 AM
anyone can help me?

The first setStore() works perfectly, and the second setStore works but with this error.