Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Row on click and tables info #140

Open
ghost opened this issue Jul 20, 2020 · 1 comment
Open

Row on click and tables info #140

ghost opened this issue Jul 20, 2020 · 1 comment
Labels
Question A user question

Comments

@ghost
Copy link

ghost commented Jul 20, 2020

Is is possible to bind event on click on each row? How?

Also do you have more explanation/ documentation how to add table info like this 'Showing 11 to 20 from 45 items' in the bottom of the table? I've tried from here but still no luck.

Thanks

@ghost ghost changed the title Row onclick Row on click and tables info Jul 20, 2020
@GerkinDev
Copy link
Owner

GerkinDev commented Jul 21, 2020

For event binding, you might want to look at 📚 the tutorials, where there is a base of what you can use. You can use custom row template:

<datatable>
    <template scope="{ row, columns, index }">
        <tr v-if="toggledRows[index]" @click="toggledRows[index] = !toggledRows[index]">
            <td :colspan="columns.length">Your open state</td>
        </tr>
        <tr v-else @click="toggledRows[index] = !toggledRows[index]">
            <td>{{ row.id }}</td>
            <td>{{ row.user.email }}</td>
            <td>{{ row.address + ', ' + row.city + ', ' + row.state }}</td>
        </tr>
    </template>
</datatable>

A new slot have been added since I closed the mentionned issue (that I have commented with the slot's link). Look at 📚 the new tutorial section.

@GerkinDev GerkinDev added the Question A user question label Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question A user question
Projects
None yet
Development

No branches or pull requests

1 participant