Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KendoUI Grid + AngularJS: Adding column template

I have a table and I wanted to add a column for a button that goes to a different page. Ideally, after column 0, it would be great that the following column 1 would have a button that calls a function that will take the user to a different page.

I am having a hard time doing the column with the template.

    <div kendo-grid
         k-sortable="true"
         k-resizable="true"
         k-pagable="true"
         k-filterable="true"
         k-data-source="model.dataSource"
         k-columns='[
            {"field": "blog", "width": "120px"},
            {"template": "<button class="k-button" ng-click="goToSite(site)"},
            {"field": "day", "width": "120px"},
            {"field": "value","width": "120px"},
            {"field": "userColor","width": "120px"}
            ]'></div>

I know there is something wrong with the template syntax, but how do I fix it??

The Kendo Dojo link is here: http://dojo.telerik.com/Ipar/6

like image 682
RedApple Avatar asked Apr 29 '26 01:04

RedApple


1 Answers

It's far today but if I modify a little bit your code on button line, it rocks :)

{"template": "<button class=\"k-button\" ng-click=\"goToSite(site)\">Go </button>"}

http://dojo.telerik.com/Ipar/33

like image 177
hazjack Avatar answered May 02 '26 02:05

hazjack