如何在dojo数据网格中显示一个复选框?

tap*_*123 3 dojo

如何在dojo数据网格中显示一个复选框?

Her*_*ert 8

我建议将cellType设置为dojox.grid.cells.Bool,而不是formatter.格式化程序为您提供了很大的自由,但也负责从之后的所有复选框(对于所有行)收集数据.这样的结构条目应该可以解决这个问题:

{
   name: "is awesome?",
   width: "auto",
   styles: "text-align: center",
   type: dojox.grid.cells.Bool, editable: true
}
Run Code Online (Sandbox Code Playgroud)

请确保使用写入存储(如ItemFileWriteStore)而不仅仅是读取存储,否则您将被禁用以实际检查复选框:)