有沒有人有一個如何將JQuery Sparklines插件集成到Kendo Grid模板的例子?Kendo Grid模板與JQuery的迷你圖
我認爲這是很簡單的事,但每次我這樣做: 模板:<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"}
]
});
您的Kendo Grid是否支持ajax?你如何設置Sparkline(在文檔準備期間;完成Kendo綁定)?一些代碼會有幫助。 –
用代碼示例更新原始問題 – RizcoTech