Dear visitor, despite the COVID-19 outbreak, our team continues operating at full speed.

Also, here is the form where you can apply for a special discount and we will contact you with possible options. Stay safe and continue achieving your business goals.

Fill the form
Get Free Trial
Get Free Trial

Toolbar tabs title not updated

Re-Open
Javier Sanz Lopez asked on May 13, 2020

Good morning.
When I create my pivot table, I want to customize the toolbar and I use the method you explain in the website, I have changed the handler, menu and icons succesfully if needed, but no matter what I do, the title of the tab remains the same even though I introduce a new String in my code.

This is the code of the methods. setupToolbar is called in the beforetoolbarcreated event and the one I am trying to change is tabs[0] from “Connect” to “Source”.

 setupToolbar(toolbar: Flexmonster.Toolbar, pivot: FlexmonsterPivot, dataSource: DataSourceModel) {
      let tabs = toolbar.getTabs();
  
      toolbar.getTabs = () => {
        tabs[0] = this.createNewTool(tabs[0], pivot.flexmonster, dataSource);
        tabs[1] = this.createNewOpenTool(tabs[1], pivot.flexmonster, dataSource);
        tabs[2] = this.createNewSaveTool(tabs[2], pivot.flexmonster, dataSource);
        console.log(‘t’, tabs);
        return tabs;
      };
  }
  
  public createNewTool(toolbarItem: Flexmonster.ToolbarTab, pivot: Flexmonster.Pivot, dataSource: DataSourceModel): Flexmonster.ToolbarTab {
    return {
      id: toolbarItem.id,
      icon: toolbarItem.icon,
      title: ‘Source’,
      menu: undefined,
      handler: () => this.openDataSourceModal(pivot, dataSource),
    }
  }

Attached you can find a screenshot of the screen and the console log that I have in that code.

Attachments:
13Mayo2.png

2 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster May 14, 2020

Hello, Javier,
 
Thank you for contacting us.
 
Our team would like to kindly explain that titles for the default Toolbar tabs are applied in according with the tab’s id. That is why the custom title is overwritten with the default one. Therefore, in case the title needs to be replaced with a custom one, the id property of the ToolbarTab object should be changed as well.
 
Please let us know if this works well for you.
Do not hesitate to contact us in case additional assistance is required.
 
Kind regards,
Illia

Public
Javier Sanz Lopez May 18, 2020

Good morning Illia.
I tried to change the id of the tab and it works perfectly. Thank you so much for the quick answer too.
 
Best regards.
Javier

Please login or Register to Submit Answer