JavaScript
var items = [{
select: true,
leistung: "Ergänzung",
typ: "",
id: 1,
tarif: "E01",
value: "",
beitrag: 100
}, {
select: false,
leistung: "Ambulant",
typ: "dropdown",
id: 2,
tarif: "A01",
value: "Item 1",
beitrag: 200
}, {
select: false,
leistung: "Stationär",
typ: "number",
id: 3,
tarif: "S01",
value: "123",
beitrag: 50
}, {
select: true,
leistung: "Pflegepflicht",
typ: "",
id: 4,
tarif: "Z01",
value: "",
beitrag: 300
}, {
select: false,
leistung: "Stationär",
typ: "",
id: 5,
tarif: "S02",
value: "",
beitrag: 50
}, {
select: false,
leistung: "Ergänzung",
typ: "",
id: 6,
tarif: "Z02",
value: "",
beitrag: 300
}];
$("#grid").kendoGrid({
dataSource: {
data: items,
schema: {
fields: {
select: {
type: 'boolean'
},
leistung: {
type: 'string'
},
value: {
type: 'string'
},
beitrag: {
type: 'number'
}
}
},
group: {
field: "leistung"
}
},
groupable: false,
columns: [{
field: "leistung",
title: " ",
editable: false,
groupHeaderTemplate: "<label style='display: inline-block; width: 275px;'>#= value#</label> <button name='button'>XYZ Assistent</button>",
width: 1,
template: ''
}, {
field: "select",
title: "Tarif",
editable: false,
width: 150,
template: "<input type='checkbox' class='SelectedCB' onclick='clickTarif(this, #=id#)' #= select ? checked='checked' : '' # /> #=tarif#"
}, {
field: "value",
title: "Vorgabe",
template: kendo.template($("#customTemplate").html()),
attributes: {
align: "right"
},
editable: false
}, {
field: "beitrag",
title: "Beitrag",
format: "{0:n2}",
width: 100,
template: '<p align="right">#=beitrag# €</p>',
editable: false
}]
});