我使用 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.