Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/03/2009, 03:13
candulterio
 
Fecha de Ingreso: marzo-2009
Mensajes: 2
Antigüedad: 15 años, 2 meses
Puntos: 0
DWR + dojox grid 1.2.3

Hola. Estoy usando el componente "grid" de dojo para mostrar los resultados de una consulta que hago por DWR. Me funciona bien pero de vez en cuando aparecen 2 errores javaScript:

* this.model.fields is null or is not an object
* this.view is null or is not an object

---------------------------------------------------------- ---------

Mi llamada DWR es la siguiente:

MiServicio.miMetodo(param1, param2, param3, param4, {callback:processData}, {errorHandler:error});

Este método me devuelve todos los datos, los cuales asigno al grid en la callback processData:

for (var i=0; i
var row = new Array()
row[0] = myArray[i].myProperty1;
row[1] = myArray[i].myProperty2;
...
row[N] = myArray[i].myPropertyN;
data[i] = row;
}

model.setData(data);

Previamenter he creado el grid (a vacío, pues no tiene datos hasta que no realizo la consulta) tal y como muestro a continuación:

gridLayout =
[{
type: 'dojox.GridRowView', width: '0px'
},
{
defaultCell: { width: 8 },

rows: [[
{ name: 'name1', width: "8%" },
{ name: 'name2, width: "18%"},
...
{ name: 'nameN, width: "18%"},
]]

}];

model = new dojox.grid.data.Table(null, null);

style="width:100%;height:65%;margin-left:2%;" ;
structure="gridLayout" onStyleRow="colorDescriptions" >



A ver si podeis ayudarme. Muchas gracias!!