-
Notifications
You must be signed in to change notification settings - Fork 394
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
Lightning-datatable has wrong type of parameters passed to custom type columns through typeAttributes that passsed not with "fieldName" #4177
Comments
I'm seeing this trying to pass options to a lightning-dual-listbox. I'm using your work-around @Paul-Kalynyn pending a fix. |
@KeithClarke i am using new workaround right now that allows you to pass options for custum picklist in column typeattributes as expected. You can create custom component that will have on public attribute for options and it will convert it from array like object to actual array. And then it will pass it to lightning combobox that is placed inside this component as slot. I mean in your edit template for datatable it will looks like this:
|
I hit this issue as well - another option I found was to use a custom setter on the option value, and convert e.g.
|
Description
I have created custom type for editing Picklist values of records using
lightning-combobox
. Inside its template it usestypeAttributes.options
foroptions
attribute. But if you specify in column configuration"typeAttributes" : { "options" : [ option1, options2 ]}
then it will pass to actualoptions
oflightning-combobox
not the specified array, but an object{ "0" : option1, "1": option2 }
. And then under the hood lightning-combobox will ignore it and use empty array for options. But if you specify column configuration with"typeAttributes" : { "options" : { "fieldName" : "actionFieldName" }
and then modify all rows of data for datatable by adding field "actionFieldName" that will contains expected options[ option1, option2 ]
as value - it will work as expected, but this kind of configuration can be called workaround.Steps to Reproduce
lightning-datatable
.lightning-combobox
inside this template with{typeAttributes.options}
as value foroptions
attribute:static customTypes
variable of created LWC use this:Expected Results
When you pass data to this custom lwc and clicks on edit button near "Custom Picklist" column value, then combobox appears with ability to choose between "Option 1" and "Option 2".
Actual Results
Combobox appears with no options to select
Version
SF Api version 60.0
The text was updated successfully, but these errors were encountered: