Reputation:
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
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
Reputation: 207
localization={{ toolbar: { searchPlaceholder: 'Placeholder' } }}
Upvotes: 0
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