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

[Solved] Custom toolbar

4 Answers 417 Views
Grid
This is a migrated thread and some comments may be shown as answers.
asd
Top achievements
Rank 1
asd asked on 30 Oct 2014, 06:38 PM
Iam tring to create custom toolbar for my grid, tried few solutions that works for standard kendo ui js but none of them works for angular.js.

Exmaple
http://dojo.telerik.com/EKeme

How to make it work ?

4 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 03 Nov 2014, 05:16 PM
Hello,

The provided example fails with a JavaScript error - custom commands should have name specified.
Adding a name to the command with template fixes the issue.
{ name: 'foo', template: kendo.template($('#template').html()) }

I hope this information will help.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
asd
Top achievements
Rank 1
answered on 03 Nov 2014, 06:43 PM
Your solution does make toolbar visible. Intentionaly I didnt put there name because in examples I found name wasnt required. Put name there and still it wont work, it will show the button with text provided in name but actual template will have no effect on button. Change anything in template and the button remains the same.
0
Alexander Valchev
Telerik team
answered on 05 Nov 2014, 03:15 PM
Hello,

First of all let me apologize for misleading you.

Command buttons located in the Grid does not support templates. The Grid's ToolBar can be either a template or a list of commands.
If you would like to use a template you should manually write the buttons mark-up. Please check the following example: http://dojo.telerik.com/EKeme/5

I also wired the click event handler of the custom command to a method from the scope.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
asd
Top achievements
Rank 1
answered on 05 Nov 2014, 09:32 PM
Thank you for this solution. Too bad I cannot avoid this hack with scope variable to create custom toolbar, but oh well atleast it works :)
Tags
Grid
Asked by
asd
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
asd
Top achievements
Rank 1
Share this question
or