Disable tooltip in toolbar

Hi, have a nice day! I want to disable tooltip in toolbar because I think it isn't necessary. Can you help me?


5 Replies

MS Manivel Sellamuthu Syncfusion Team July 30, 2021 10:02 AM UTC

Hi Toan, 
 
Greetings from Syncfusion support. 
 
By default in Toolbar if we are not defining tooltipText will not show tooltip. Please refer the below code example and sample for more information. 
 
<div class="control-section e-tbar-section"> 
    <div class="e-sample-resize-container"> 
        <!-- Render the Toolbar Component --> 
        <ejs-toolbar> 
            <e-items> 
                <e-item prefixIcon='e-cut-icon tb-icons'></e-item> 
                <e-item prefixIcon='e-copy-icon tb-icons'></e-item> 
                <e-item prefixIcon='e-paste-icon tb-icons'></e-item> 
                <e-item type='Separator'></e-item> 
                <e-item prefixIcon='e-bold-icon tb-icons' tooltipText='Bold'></e-item> 
                <e-item prefixIcon='e-underline-icon tb-icons' tooltipText='Underline'></e-item> 
            </e-items> 
        </ejs-toolbar> 
    </div> 
</div> 
 
 
If you want to hide the tooltip text in the Grid Toolbar you can achieve your requirement by using the below solution. In the below sample we have removed  the tooltipText of the toolbar items in the created event and refreshed the toolbar items in the dataBound event using flag variable. Please refer the below code example and sample for more information. 
 
<div class="control-section"> 
    <ejs-grid #grid [dataSource]='data' allowPaging='true' (created)="created($event)" (dataBound)="dataBound()"  
[pageSettings]='pageSettings' [editSettings]='editSettings' [toolbar]='toolbar'> 
        <e-columns> 
         . . . 
        </e-columns> 
    </ejs-grid> 
</div> 
export class AppComponent { 
    @ViewChild ('grid', {statictrue}) 
    public gridGridComponent; 
    public flag = true; 
 
 . . . 
    created() { 
        this.grid.toolbarModule.toolbar.items.forEach((e)=>{e.tooltipText = ''}); 
    } 
 
    dataBound () { 
        if (this.flag) { 
            this.flag = false; 
            (this.grid.toolbarModule as any).refreshToolbarItems() 
        } 
    } 
} 
 
 
Please let us know if you need further assistance. 
 
Regards, 
Manivel 



TB Toan Bui August 2, 2021 03:14 AM UTC

I did it. Thank you so much. So can i do the same thing with treegrid?



FS Farveen Sulthana Thameeztheen Basha Syncfusion Team August 3, 2021 01:44 PM UTC

Hi Toan, 

Thanks for your update. 

Query#:- So can i do the same thing with treegrid? 
 
Yes we have achieved the same in TreeGrid (hide the Tooltip text in TreeGrid Toolbar) using created and dataBound events of the TreeGrid. 

Refer to the code below:- 
App.Component.html:- 
 
<ejs-treegrid #treegrid [dataSource]='data' height='400' childMapping='subtasks' [treeColumnIndex]='1' 
[editSettings]='editSettings' [toolbar]='toolbar' (created)="created($event)" (dataBound)="dataBound()"> 
    <e-columns> 
        <e-column field='taskID' headerText='Task ID' width='70' textAlign='Right' isPrimaryKey='true' 
                  [validationRules]='taskidrules'></e-column> 
        <e-column field='taskName' headerText='Task Name' width='180' editType='stringedit' 
                  [validationRules]='tasknamerules'> 
            </e-column > 
            .  .   . 
     </e-columns > 
</ejs-treegrid > 
 
App.Component.ts 

export class AppComponent { 
    public data: Object[] = []; 
    public editSettings: Object; 
    public toolbar: string[]; 
    @ViewChild('treegrid') 
    public treegrid: TreeGridComponent; 
 
   created() { 
      this.treegrid.grid.toolbarModule.toolbar.items.forEach(e => { 
        e.tooltipText = ''; 
        }); 
    } 
 
  dataBound() { 
     if (this.flag) { 
       this.flag = false; 
       this.treegrid.grid.toolbarModule.refreshToolbarItems(); 
      } 
    } 


 
Please get back to us if you need any further assistance. 

Regards, 
Farveen sulthana T 



TB Toan Bui August 5, 2021 08:32 AM UTC

I did it. Thank you so much



FS Farveen Sulthana Thameeztheen Basha Syncfusion Team August 6, 2021 12:14 PM UTC

Hi Toan,  

Thanks for your update. Please get back to us if you need any further assistance on it. We are happy to assist you. 

Regards, 
Farveen sulthana T 


Loader.
Up arrow icon