user10817219
user10817219

Reputation:

Material dataTable

How to use the materials table API ,Link to Material Table

For example, I want to change search placeHolder form "Search" to "Recherche".

I already tried this but it dosn't work for me

<MaterialTable
  title=""
  columns={state.columns}
  data={state.data}
  options={{
    sorting: true,
    searchPlaceholder: "recherche"
  }}
/>

Thanks for your help

Upvotes: 1

Views: 103

Answers (3)

Diamond
Diamond

Reputation: 3428

According to the npm package(almost last line)

export interface Localization {
  ...
  toolbar?: {
    ...
    searchPlaceholder?: string;
  };
}

So your codes should be like below;

<MaterialTable
  title=""
  columns={state.columns}
  data={state.data}
  options={{
    sorting: true,
  }}
  localization={{ toolbar: { searchPlaceholder: 'recherche' } }}
/>

Upvotes: 2

Baruch_Mashasha
Baruch_Mashasha

Reputation: 207

localization={{ toolbar: { searchPlaceholder: 'Placeholder' } }}

Upvotes: 0

Artemiy Vereshchinskiy
Artemiy Vereshchinskiy

Reputation: 132

Have you tried

<MaterialTable
  title=""
  columns={state.columns}
  data={state.data}
  options={{
    sorting: true,
    filterPlaceholder: "recherche" // instead of searchPlaceholder
  }}
/>

or toolbar.searchPlaceholder ?

Upvotes: 0

Related Questions