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

DataTable rowClick returns a dom event with no data property #91

Closed
fairking opened this issue Nov 20, 2019 · 1 comment
Closed

DataTable rowClick returns a dom event with no data property #91

fairking opened this issue Nov 20, 2019 · 1 comment
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@fairking
Copy link

fairking commented Nov 20, 2019

As the documentation says the DataTable rowClick sends an object which contains a property data but looks like it sends the dom event itself.
Bellow my example. I included my other bindings just in case if you need more info.

<DataTable
			ref="dt"
			:value="rows"
			:selection.sync="selectedRows"
			:paginator="true"
			:rows="pageSize"
			:lazy="true"
			:loading="loading"
			:total-records="totalRows"
			:row-hover="true"
			class="p-datatable-responsive"
			data-key="id"
			paginator-position="bottom"
			:export-filename="exportFileName"
			:auto-layout="true"
			@row-select="rowSelect($event)"
			@page="pageData($event)"
			@sort="sortData($event)"
			@row-click="rowClick($event)"
		>
<Column selection-mode="multiple" header-style="width: 32px;"></Column>
<slot></slot>
<template #empty>
 No records
</template>
</DataTable>

TypeScript:

methods: {
    rowSelect(e) { this.$emit("row-select", e.data.id); },
    rowClick(e) { console.log(e); this.$emit("row-click", e.data.id); },
}

image

image

@cagataycivici cagataycivici self-assigned this Dec 4, 2019
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Dec 4, 2019
@cagataycivici cagataycivici added this to the 1.0.0-beta.15 milestone Dec 4, 2019
@fairking
Copy link
Author

fairking commented Dec 4, 2019

Thank you @cagataycivici

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants