1
cell = document.createElement("td");
cell.setAttribute("colspan", "1");
cell.setAttribute("valign", "top");
var grid = new dojox.grid.DataGrid({
    id: "gridID",
    store: new dojo.data.ItemFileWriteStore({data: {items: []}}),
    elasticView: "2",
    selectionMode: "single",
    autoWidth: "true",
    rowCount: "4",
    layout: [{field: "name", editable: "false", width:"160px", name:"fieldname"}],
    query: "{itemID:'*'}"
}).placeAt(cell);
grid.startup();
row.appendChild(cell); 

启动后会抛出错误“cell is undefined”(943 out of range 516)

4

1 回答 1

2

总是仔细检查白痴的错误。“布局”应该是“结构”。应该弹出比单元格未定义更好的消息。

于 2010-06-21T17:39:12.417 回答