This is a migrated thread and some comments may be shown as answers.

Kendo Grid Template with JQuery sparklines

1 Answer 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 23 Aug 2012, 10:20 PM
Does anyone have an example of how to integrate the JQuery Sparklines plugin into the Kendo Grid template? 

JQuery Sparklines: http://omnipotent.net/jquery.sparkline/#s-about 

I would think this is rather simple to do, but every time I do something like: 
template:'<span class="inlinebar">75,25,0,100</span>' 
only the values  75,25,0,100 are displayed in the grid, not the actual sparkline.

I would appreciate if someone could post a sample or solution. Thanks!

1 Answer, 1 is accepted

Sort by
0
Thomas
Top achievements
Rank 1
answered on 28 Aug 2012, 06:04 PM
I was able to resolve this!

Add the following template to columns:
template: '<span class="inlinebar">[Array of numbers]</span>'
where [Array of numbers] is the result set you are returning


Make sure to add the jquery sparkline call in the dataBound function of the grid.
dataBound: function(e)
    {
    ($('.inlinebar').sparkline('html', {type: 'bullet', width: '75'}));
    }

voila!
Tags
Grid
Asked by
Thomas
Top achievements
Rank 1
Answers by
Thomas
Top achievements
Rank 1
Share this question
or