나는 footerTemplate을 검도 UI 그리드와 함께 사용하려고합니다. 나는 테이블의 꼬리말에 'hours_worked'의 합을 얻고 싶습니다. 검도 UI 예제에서 몇 가지 옵션을 시도했지만 저에게는 효과가 없습니다. 뭐가 잘못 됐니?검도 UI : footeremplate의 합
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: {
transport:
read: {
url: "mods/hours/data/get_hours.php?id=<?php echo $volunteer_id; ?>",
dataType: "json"
}
},
schema: {
model: {
fields: {
hours_id: { type: "number" },
volunteer_first_name: { type: "string" },
volunteer_last_name: { type: "string" },
hours_date: { type: "date" },
location_name: { type: "string" },
work_type_name: { type: "string" },
volunteer_id: { type: "number" },
hours_worked: { type: "number" }
}
}
},
aggregate:[{ field:"hours_worked", aggregate:"sum" }],
pageSize: 10
},
height: 350,
filterable: true,
sortable: true,
pageable: true,
selectable:true,
columns: [
{
title:"Naam",
template:"#=volunteer_last_name#, #=volunteer_first_name#",
},{
title:"Locatie",
field:"location_name",
},{
title:"Werkzaamheden",
field:"work_type_name",
},{
title:"Uren",
field:"hours_worked",
footerTemplate:"Sum: #=sum#",
},{
title:"Datum",
field:"hours_date",
},{
width:"200px",
title:"Opties",
filterable: false,
template:"<a href='?p=edit_reported_hours&id=#=volunteer_id#&hours_id=#=hours_id#' class='k-button'>Bewerken</a> <a href='?p=manage_reported_hours&o=delete&id=#=volunteer_id#&hours_id=#=hours_id#' class='k-button'>Delete</a>"
},
]
});
});
</script>
, 그것은'number'해야한다. – OnaBai
빠른 답변 주셔서 감사합니다하지만 해결되지 않습니다 ... 바닥 글 템플릿이 표시되지 않습니다. – zxcvb