![](/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.