Change name for built in toolbar in childdatagrid in vue

Hello,
I wanted to change the name in built-in toolbar in the child data grid in Vue.

I try to add like this but doesn't work.


Please guide me and if possible then share an example.


3 Replies

SK Sujith Kumar Rajkumar Syncfusion Team July 27, 2021 08:13 AM UTC

Hi Shivani, 
 
Greetings from Syncfusion support. 
 
You can achieve your requirement of changing the default toolbar item text for child Grid alone by modifying the corresponding toolbar item’s text property value of the child Grid’s toolbar module in the parent Grid’s detailDataBound(triggers after initial detail row expand) event handler. 
 
This is demonstrated in the below code snippet, 
 
// Grid’s detailDataBound event handler 
onDetailDataBound(args) { 
   args.childGrid.toolbarModule.toolbar.items.forEach( item => {  
       // Change the toolbar text for the required Grid toolbar item 
       if(item.text === "Add")  
          item.text = "Add record"; 
  }); 
} 
 
We have prepared a sample based on this for your reference. You can find it below, 
 
 
 
Please get back to us if you require any further assistance. 
 
Regards, 
Sujith R 



SH Shivani replied to Sujith Kumar Rajkumar July 28, 2021 03:18 AM UTC

Thank you so much for your quick reply. It really helps me



SK Sujith Kumar Rajkumar Syncfusion Team July 28, 2021 06:42 AM UTC

Hi Shivani, 
 
You’re welcome. We are glad to hear that your query has been resolved. 
 
Regards, 
Sujith R 


Loader.
Up arrow icon