at-ui icon indicating copy to clipboard operation
at-ui copied to clipboard

<at-table...>, Insert 'Edit' link, filter table

Open inzanez opened this issue 7 years ago • 4 comments

Hi there

I just started to check out AT-UI and I like it very much so far! I just got two things I'm missing from the documentation:

  • Is there any way to display links inside a table? I got an array of JSON objects that make up the table data. I would like to add a column "Edit" for each entry that will route to an edit component when clicked. I didn't find that possibilty so far?
  • Is there any way to have filters for each column of a table?

Best regards

inzanez avatar Dec 04 '17 23:12 inzanez

  1. Custom Column Template use render function https://vuejs.org/v2/guide/render-function.html

  2. sorry, the current version does not support this feature :(

koppthe avatar Dec 05 '17 13:12 koppthe

        title: 'Action',
        render (h) {
             return (<a href="/flights/topAirlines/edit/XXXXX"><i class='icon icon-edit-1'></i></a>)
        }

The following code perfectly fine for me... @koppthe, can you help me displaying dynamic value at the place of XXXXX

creativemind1 avatar Dec 13 '17 07:12 creativemind1

render: (h, params) => {

The params object contains the information about the row, you can use that to insert something in the url. Hope this helps.

JelteJ avatar Apr 07 '18 14:04 JelteJ

wouldnt it be more elegant to provide some kind of dynamic slot (via column key) to override the default cell template with?

<at-table :columns="columns1" :data="data1" stripe>
    <template name="columnkey">
        <h1>{{ column.value }}</h1>
    </template>
</at-table>

https://vuejs.org/v2/guide/components-slots.html#Scoped-Slots

joernroeder avatar Apr 23 '18 15:04 joernroeder