【发布时间】:2017-06-17 05:00:11
【问题描述】:
我正在使用剑道网格中的模板来创建复选框:
$("#grid").kendoGrid({
dataSource: {
data: products,
schema: {
model: {
fields: {
ProductName: { type: "string" },
UnitPrice: { type: "number" },
UnitsInStock: { type: "number" },
Discontinued: { type: "boolean" }
}
}
},
pageSize: 20
},
height: 550,
scrollable: true,
sortable: true,
pageable: {
input: true,
numeric: false
},
columns: [
{
field:'<div style="text-align: center"><input id="masterCheck" class="k-checkbox" type="checkbox" /><label class="k-checkbox-label" for="masterCheck"></label></div>',
template: '<div style="text-align: center"><input id="${ProductName}" type="checkbox" class="k-checkbox rowSelect"/><label class="k-checkbox-label" for="${ProductName}"></label></div>',
headerAttributes:{ style:"text-align:center"},
width: 38,
editable: false,
sortable: false // may want to make this sortable later. will need to build a custom sorter.
},
"ProductName",
{ field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "130px" },
{ field: "UnitsInStock", title: "Units In Stock", width: "130px" },
{ field: "Discontinued", width: "130px" }
]
});
});
这里是道场的代码:http://dojo.telerik.com/IVopi
您会注意到复选框未在网格单元格中居中。如何在网格单元格中将复选框居中?
【问题讨论】:
标签: css kendo-ui telerik kendo-grid