Changing the label on the edit toolbar name

Would anyone know if it's possible to change the default toolbar menu option labels? 

I'd like the original Edit toolbar option to say "rotate" instead.


let grid: Grid = new Grid({
    dataSource: data,
    toolbar: ['Edit', {tooltipText: "Rotate", prefixIcon: 'fa fa-repeat', 
text: "Rotate", id:"rotate"], editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true }, columns: [
...​ ], height: 265 });

Screenshot 2023-12-27 at 10.19.17 AM.png



1 Reply

HS Hemanthkumar S Syncfusion Team January 2, 2024 04:40 AM UTC

Hi Jason Nham,


Greetings from Syncfusion support.


Query: Would anyone know if it's possible to change the default toolbar menu option labels?. I'd like the original Edit toolbar option to say "rotate" instead.


Based on the information you provided, it appears that you want to change the default text of the Edit button in the toolbar. To fulfill this requirement, we recommend using the Localization library, which enables you to localize the default text content of the Grid. The grid component includes static text in some features, such as group drop area text, pager information text, etc. You can change this static text by defining the locale value and translation object.


For more information, please refer to the below code example, screenshot, documentation, and sample.


[index.js]

 

ej.base.L10n.load({

  'en-US': {

    grid: {

      Edit: 'rotate',

    },

  },

});

 

var grid = new ej.grids.Grid({

  dataSource: window.orderDataSource,

  locale: 'en-US',

  editSettings: {

    allowEditing: true,

    allowAdding: true,

    allowDeleting: true,

    mode: 'Normal',

    newRowPosition: 'Top',

  },

  allowPaging: true,

  pageSettings: { pageCount: 5 },

  toolbar: ['Add''Edit''Delete''Update''Cancel'],

  actionBegin: actionBegin,

 


A screenshot of a computer screen

Description automatically generated


Localization: https://ej2.syncfusion.com/javascript/documentation/grid/global-local


Sample: https://stackblitz.com/edit/z9rmay?file=index.js


Please feel free to contact us if you require any further assistance. We are always available and eager to help you in any way we can.


Regards,

Hemanth Kumar S


Loader.
Up arrow icon