我使用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.
答案 0 :(得分:0)
我能够通过以下方式替换您的布局来实现这一目标。某些字段可能不起作用,因为它们是特定于实现的,但是在这些更改之后我没有看到rowIndex或类似的东西。
var myDojolayout = [
{
type : "dojox.grid._CheckBoxSelector"
},
// Now include the data cells in a view occupying the rest of the grid.
{ cells: [{
name : "Summary",
fields : [ "firstName", "lastName",
"companyName", "phone", "email" ],
editable : true,
width : "500px",
formatter : function(fields) {
var first = fields[0], last = fields[1], notes = fields[2], phone = fields[3], email = fields[4],companyName= fields[5];
return first + " " + last + "<br>"
+ companyName + "<br>" + phone
+ "<br>" + email;
}}]
}
];