RedApple
RedApple

Reputation: 201

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

Upvotes: 3

Views: 4449

Answers (1)

hazjack
hazjack

Reputation: 1715

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

Upvotes: 3

Related Questions