Open MarkoSh opened 1 month ago
I have a select element where I change the text of an option. In normal time without a plugin this works fine just by using this piece of code:
option.text = ${ option.DEFAULT_TEXT }: fans ${ arr.length }${ total ?, spent $${ total }: '' };
${ option.DEFAULT_TEXT }: fans ${ arr.length }${ total ?
: '' }
When using the plugin I have to do destroy and init. Alternatively, I tried doing this:
choices._currentState.choices.map( ( choice: any ) => { choice.label = 'Changed'; // } );
But once applied, you have to select one of the items for the texts to change. It would be nice to get a tutorial on how to make the text change in real time something like this:
const choice = choices.getChoiceByValue( 'value_name' ); const customProperties = choice.customProperties; const DEFAULT_TEXT = customProperties.DEFAULT_TEXT; choices.setTextByValue( 'value_name', ${ DEFAULT_TEXT }: blablabla );
${ DEFAULT_TEXT }: blablabla
without reloading the element, but redraw it, even with dropdown
If it works - it's not stupid ))) It works cool as i want, just working on reset scroll position in dropdown, but looks cool in real time
I have a select element where I change the text of an option. In normal time without a plugin this works fine just by using this piece of code:
option.text =
${ option.DEFAULT_TEXT }: fans ${ arr.length }${ total ?
, spent $${ total }: '' }
;When using the plugin I have to do destroy and init. Alternatively, I tried doing this:
choices._currentState.choices.map( ( choice: any ) => { choice.label = 'Changed'; // } );
But once applied, you have to select one of the items for the texts to change. It would be nice to get a tutorial on how to make the text change in real time something like this:
const choice = choices.getChoiceByValue( 'value_name' ); const customProperties = choice.customProperties; const DEFAULT_TEXT = customProperties.DEFAULT_TEXT; choices.setTextByValue( 'value_name',
${ DEFAULT_TEXT }: blablabla
);without reloading the element, but redraw it, even with dropdown