私は、チェックボックスを作成するために、剣道グリッドのテンプレートを使用しています:センター剣道グリッドセルのチェックボックス
$("#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
あなたがチェックボックスに気付くでしょうグリッドセルの中央に配置されていません。グリッドセルにチェックボックスの中心を合わせるにはどうしたらいいですか?