Welcome to the JavaScript feedback portal. We’re happy you’re here! If you have feedback on how to improve the JavaScript, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote

Greetings,

I want a JS ListBox component run a function when it is created (mainly to fit its toolbar to a certain design):

const listbox = new ej.dropdowns.ListBox({
    dataSource: data,
    fields: { text: 'id' },
    scope: '#scope',
    toolbarSettings: { items: ['moveTo', 'moveFrom'], position: 'Left' },
    created: fixToolbar('#scope'),
});

But I found out that 'created: fixToolbar()' actually runs before the component is fully created so I can't poke to the nodes that are rendered when created (the toolbar).

Afterwards found out that if I do

listbox.addEventListener('created', fixToolbar('#scope'));

it works as intended, but the thing is that this fixToolbar() function doesn't return anything - it needs to be passed to addEventListener as an anonymous function. But when I do something like

listbox.addEventListener('created', () => { fixToolbar('#scope') });

or even

listbox.addEventListener('created', function() { fixToolbar('#scope') });

the function fixToolbar() won't run at all.

I'm running EJ2 23.2.4 if that matters.