【发布时间】:2012-05-31 20:41:27
【问题描述】:
我使用 dojox.grid.DataGrid 来呈现表格。我还在第一列中包含了 dojox.grid._CheckBoxSelector。我看到在复选框列和实际数据列之间总是呈现一个名为 Row 的列。
能否请您告诉我如何不呈现此 Row 索引列?创建结构时我可以设置任何标志吗?还是我需要删除任何字段?
非常感谢。
==========================================
dojo
.ready(function() {
var myDojolayout = [
{
type : "dojox.grid._CheckBoxSelector"
},
// Now include the data cells in a view occupying the rest of the grid.
[
new dojox.grid.cells.RowIndex({
width : "10%"
}),
{
name : "Summary",
fields : [ "firstName", "lastName",
"companyName", "phone", "email" ],
editable : true,
width : "10%",
formatter : function(fields) {
var first = fields[0], last = fields[1], notes = fields[2], phone = fields[3], email = fields[4];
return first + " " + last + "<br>"
+ companyName + "<br>" + phone
+ "<br>" + email;
}
}
] ]
var mygrid = new dojox.grid.DataGrid({
id : "gridId",
store : store,
autowidth : "true",
rowselector : "15px",
keepRows : "30",
rowsPerPage : "10",
style : "height:300px",
structure : myDojolayout
}, "gridContainer");
mygrid.startup();
dojo.connect(mygrid, "onApplyEdit", function(row) {
store.
【问题讨论】:
-
这不是因为你的布局有新的 dojox.grid.cells.RowIndex({ width : "10%" })
-
您好,感谢您的回复。我删除了新的 dojox.grid.cells.RowIndex({width : "10%" }) 行,但该列仍然显示。还有其他解决方案吗?非常感谢。
标签: dojo