【发布时间】:2011-08-13 06:56:16
【问题描述】:
我正在为我的 Dojo 1.5 DataGrid 使用以下布局:
function getGridLayout() {
return [{
name: "Stylist",
field: "stylist",
width: "100px"
},
{
name: "Service",
field: "service",
width: "200px"
},
{
name: "Length",
field: "length",
width: "50px"
},
{
name: " ",
field: "remove",
width: "30px",
formatter: getRemoveFormatter
}];
}
这是我的回调定义:
function getRemoveFormatter(item) {
console.log(item);
}
这就是我创建 DataGrid 的方式:
dojo.ready(function() {
var store = new dojo.data.ItemFileWriteStore({data:{items:[]}});
window.grid = new dojox.grid.DataGrid({store: store, structure: getGridLayout()}, document.createElement("div"));
dojo.byId("services_grid").appendChild(grid.domNode);
grid.startup();
observeAppointmentServiceAddClick(window.grid);
getAppointmentItems();
});
由于某种原因,item 始终是undefined。知道为什么会这样吗?
【问题讨论】:
标签: javascript datagrid dojo