Material-table: How do i add page link to field.

Created on 6 Aug 2019  Â·  5Comments  Â·  Source: mbrn/material-table

How do i add page link to field.

help wanted

Most helpful comment

You can use custom render:

columns={[
    {
        field: 'name',
        title: 'Name',
        render: rowData => <a href=`/profile/${rowData.name}`>{rowData.name}</a>
    }
]}

All 5 comments

You can use custom render:

columns={[
    {
        field: 'name',
        title: 'Name',
        render: rowData => <a href=`/profile/${rowData.name}`>{rowData.name}</a>
    }
]}

I need to pass query params to link but i m not able to ,
const columns = [
{
title: "Theme Name",
field: "theme_name",
render: rowData => ${rowData.id}
state={{id:rowData.id}}>{rowData.theme_name}
},

{
title: "Batch",
field: "batch_id",
lookup: this.state.batches
},
{
title: "Class",
field: "class_id",
lookup: this.state.classes
}
];

On Tue, Aug 6, 2019 at 2:11 PM Emre KARA notifications@github.com wrote:

Closed #935 https://github.com/mbrn/material-table/issues/935.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/mbrn/material-table/issues/935?email_source=notifications&email_token=AF475CX3WBXL2UVIV6NFD4DQDE2LVA5CNFSM4IJTJC22YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOS4TYBQI#event-2535948481,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF475CTQCENBEFEA3PRHQOTQDE2LVANCNFSM4IJTJC2Q
.

Can you show some codesandbox with that problem?
Why are you using two string literals:

to="scene/" + `${rowData.id}`

and not

to=`scene/${rowData.id}`

i close this issue. reopen if you needed please

Was this page helpful?
0 / 5 - 0 ratings