Back to forum

How can I add custom tool bar and custom tool bar buttons

Resolved

I am trying to present multiple pivots without toolbar in my Angular 4 application, So I want to integrate custom tool bar with my own buttons and I want to call toolbar actions with my own custom button clicks is it possible?

3 answers

WebDataRocks Team ⋅ WebDataRocks ⋅ August 13, 2018

Hi!
You can customize the Toolbar using beforetoolbarcreated event. This event gets toolbar object, its method getTabs() should be used to add/remove tabs. Please check the following example with two custom tabs: https://codepen.io/webdatarocks/pen/mjoxve. Handler for beforetoolbarcreated event is set on line 3.
Hope it helps.
Regards,
WebDataRocks Team

Ramarkishna ⋅ August 13, 2018

My intention is to use my own buttons and bind functions to that in Angular 4 application, not changing the theme

WebDataRocks Team ⋅ WebDataRocks ⋅ August 14, 2018

Hello Ramarkishna,
The approach suggested above is very flexible. You can rewrite the 10-th line of the example the following way:
var tabs = [];
In such case, only the custom tabs will remain in the array.
Hope it was helpful.
Regards,
WebDataRoks Team
 

Move up