-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 : column name with dot #3548
Comments
Mani-Santhosh
added
the
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
label
Nov 1, 2022
Mani-Santhosh
changed the title
Datatable : column name with dot
DataTable : column name with dot
Nov 1, 2022
Can you provide a link to your code sandbox please? |
melloware
added
Type: Bug
Issue contains a defect related to a specific component.
and removed
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
labels
Nov 2, 2022
Thanks for the reproducer confirmed the issue is right here: static resolveFieldData(data, field) {
if (data && Object.keys(data).length && field) {
if (this.isFunction(field)) {
return field(data);
} else if (field.indexOf('.') === -1) {
return data[field];
} else {
let fields = field.split('.');
let value = data;
for (var i = 0, len = fields.length; i < len; ++i) {
if (value == null) {
return null;
}
value = value[fields[i]];
}
return value;
}
} else {
return null;
}
} |
melloware
added a commit
to melloware/primereact
that referenced
this issue
Nov 2, 2022
melloware
added a commit
to melloware/primereact
that referenced
this issue
Nov 2, 2022
Thanks @melloware |
melloware
added a commit
that referenced
this issue
Nov 2, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
In the dynamic data table field, the value contains a dot(.) operator that entier the column displayed empty.
eg: { field: "code 2.2", header: "Code 2.2" }
Code 2.2 column displayed empty
Reproducer
No response
PrimeReact version
8
React version
18.x
Language
ES6
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
Column name with dot is not showing data
Expected behavior
data would show
The text was updated successfully, but these errors were encountered: