Select option custom attribute #103
-
How to add custom attribute to option and detect on change? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
As of now, we could set only value and label properties in the options details. I will support to add custom data with options details in the future release. |
Beta Was this translation helpful? Give feedback.
-
@Sabyrzhanuly you can set VirtualSelect.init({
ele: '#sample-select',
options: [
{ label: 'Options 1', value: '1', customData: 'text' },
{ label: 'Options 2', value: '2', customData: 6 },
{ label: 'Options 3', value: '3', customData: { cv1: true } },
],
}); This feature is available in the release v1.0.26 |
Beta Was this translation helpful? Give feedback.
-
Hello, If we need to add customData directly to the options instead of initiating from jquery, What I should do? Say, Thanks in advance :-) |
Beta Was this translation helpful? Give feedback.
-
@pjasminejeni you can use options[].customData |
Beta Was this translation helpful? Give feedback.
@Sabyrzhanuly you can set
customData
with options details and it would be returned ongetSelectedOptions()
method call.This feature is available in the release v1.0.26