Login Register

two ways of defining a editable grid

ONE.
Hi. I can define a editable grid like that:

var layout=[{rows: [[
{name: 'Column0', editor: dojox.grid.editors.Input},
{name: 'Column1', editor: dojox.grid.editors.Input},
]]}];

data = [
["l11", "l12cxxx"],
["l21", "l22"],
["l31", "l32"]
]
var model=new dojox.grid.data.Objects(null, data);

TWO.
But if i want to define the data with attributes instead of using arrays, the grid doesn't became editable:
Each time i double click in a cell, it gives an error: "this.getRow(inRowIndex).slice is not a function"

This means that i have to define the data as arrays? OR this is a bug... OR i'm missing something?

(This is the second way, the one that doesn't work well:)

var layout=[{rows: [[
{name: 'Column0', field:'col1', editor: dojox.grid.editors.Input},
{name: 'Column1', field:'col2', editor: dojox.grid.editors.Input},
]]}];
data = [
{col1: "l11", col2: "l12cxxx"},
{col1: "l21", col2: "l22"},
{col1: "l31", col2: "l32"}
]
var model=new dojox.grid.data.Objects(null, data);