![](/img/trans.png)
[英]Add column with a button which helps to route to a new page (when clicks) in material-table react
[英]Add a button to react material-table toolbar
我想在材料表工具栏上添加一个按钮。 它不做任何与表格相关的事情。 它只是打开一个带有一些信息的模式
我想在“添加项目”按钮的左侧添加一个名为“引用”的按钮。
沙盒代码: https : //codesandbox.io/embed/charming-yalow-4pnk4? fontsize =14& hidenavigation =1& theme =dark
根据文档,您似乎需要覆盖表格的 Toolbar 组件,并且您应该能够在列标题上方添加任何您想要的内容:
https://material-table.com/#/docs/features/component-overriding
正如威尔·埃弗斯提到,有可能添加任何必要Toolbar
的的MaterialTable
使用组件Toolbar
道具:
Toolbar: (props) => (
<div
style={{
display: "flex",
justifyContent: "flex-end",
alignItems: "center"
}}
>
<Button
style={{ height: "fit-content" }}
color="primary"
variant="contained"
>
Quotations
</Button>
<div style={{ width: "13rem" }}>
<MTableToolbar {...props} />
</div>
</div>
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.