有没有人有如何将 JQuery Sparklines 插件集成到 Kendo Grid 模板中的示例?
我认为这很简单,但每次我做类似的事情时:模板:<span class="inlinebar">75,25,0,100</span>
只有值 75,25,0,100 显示在网格中,而不是实际的迷你图。
如果有人可以发布示例或解决方案,我将不胜感激。谢谢!
代码示例:
<script>
$('.inlinebar').sparkline('html', {type: 'bullet'});
$(document).ready(function() {
$("#grid").hide();
var grid = $("#grid").kendoGrid({
dataSource: {
transport: {
read: {
url: "/Services/testService",
dataType: "json",
type: "GET",
data: {
}
}
},
schema: {
model: {
fields: {
field1: {type: "number"},
field2: {type: "number"},
field3: {type: "number"}
}
}
},
pageSize: 15
},
selectable:"cell",
toolbar: kendo.template($("#template").html()),
height: 350,
filterable: true,
scrollable: true,
sortable: true,
pageable: true,
columns: [
{field: "field1", title: "Field 1"},
{field: "field2", title: "Field 2", template:'<span class="inlinebar">75,25,0,100</span>'},
{field: "field3", title: "Field 3"}
]
});