You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57
Current behavior
DataTable callback onRowClick?(e: RowClickEventParams): void; method uses RowClickEventParams which extends EventParams interface. This interface has 'value' attribute provided for row data. It compiles with typescript correctly, but in production, data are stored in attribute 'data', not in attribute 'value'.
onClick(event) {
if (this.props.onClick) {
this.props.onClick({
originalEvent: event,
data: this.props.rowData, // this should be 'value: this.props.rowData'
index: this.props.rowIndex
});
}
}
Expected behavior
EventParams interface will either rename 'value' into 'data' or fill 'value' attribute with row data.
Minimal reproduction of the problem with instructions
Create <DataTable onRowClick={e => {
console.log(e.value); // returns undefined or null
// @ts-ignore
console.log(e.data); // returns data, but data is not present in 'e' as attribute
}}
Please tell us about your environment:
Windows 10, Intellij IDEA, npm v14.16.1, Spring boot backend
React version:
"react": "^17.0.2",
PrimeReact version:
"primereact": "^6.3.0",
Browser: [Chrome Version 90.0.4430.85 (Official Build) (64-bit)]
Language: [TypeScript 4.2.4 | ES5]
The text was updated successfully, but these errors were encountered:
Current behavior
DataTable callback onRowClick?(e: RowClickEventParams): void; method uses RowClickEventParams which extends EventParams interface. This interface has 'value' attribute provided for row data. It compiles with typescript correctly, but in production, data are stored in attribute 'data', not in attribute 'value'.
primereact/src/components/datatable/BodyRow.js
Line 6 in 6307ec9
Expected behavior
EventParams interface will either rename 'value' into 'data' or fill 'value' attribute with row data.
Minimal reproduction of the problem with instructions
Please tell us about your environment:
Windows 10, Intellij IDEA, npm v14.16.1, Spring boot backend
React version:
"react": "^17.0.2",
PrimeReact version:
"primereact": "^6.3.0",
Browser: [Chrome Version 90.0.4430.85 (Official Build) (64-bit)]
Language: [TypeScript 4.2.4 | ES5]
The text was updated successfully, but these errors were encountered: