KendoUI Grid + AngularJS: Add Column Template

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

I'm having a hard time making a column with a 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

+3


source to share


1 answer


Until today, but if I modify your code on the button a bit, it's rocks :)

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

      



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

+3


source







All Articles