We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

ListBox select event not working as expected

Hi,

I am using ListBox exactly as described in the documentation site. Functionally it works good: dataSource loaded, the Fields property taking effect, I can interact with it.

I add (select) event to the ejs-listbox to be able to adjust data on other user inputs/ controls. The event is not firing. 

I am also defining the following css to make the selected item look more visible to human eyes of all strengths. I can see the list items change the selected status when I inspect the html elements, but the styles take no effect.

.e-list-item .e-selected {
background-color: red;
color: white;
}

I am using syncfusion @17.3.26. Please help point me to the right direction... what am I missing here?

Thanks and best regards,
Sathya

5 Replies

MV Madhan Venkateshan Syncfusion Team November 18, 2019 05:33 AM UTC

Hi Sathya, 
 
Good day to you. 
 
Query #1: I add (select) event to the ejs-listbox to be able to adjust data on other user inputs/ controls. The event is not firing.  
 
Sorry for the inconvenience caused. We have depreciated select event instead we provided change event and it will fire when you select the listbox items and also prepared a sample to log the change event in the console, please refer the below link 
 
 
Query #2: I can see the list items change the selected status when I inspect the html elements, but the styles take no effect. 
 
We would suggest you to increase the css specificity to override the existing css styles. Please refer the below code snippets 
 
App.component.css 
.e-listbox-wrapper .e-list-item.e-selected { 
    background-color: red; 
    color: white; 
} 
  
Regards, 
Madhan V 



SS Sathyanarayanan Srinivasan November 19, 2019 03:52 AM UTC

Thank you Madhan. Works like a charm :)


MV Madhan Venkateshan Syncfusion Team November 20, 2019 06:43 AM UTC

Hi Sathya, 
 
Thanks for your update, Please feel free to contact us if you need any further assistance on this. 
 
Regards, 
Madhan V 



AL Anderson Luiz Ferrari March 10, 2021 01:35 PM UTC


"change" event worked, but can you please ask for someone to update the documentation, so you don't mislead more developers on that:

https://ej2.syncfusion.com/angular/documentation/list-box/selection/

On selection of each list box item, select event is triggered.

Thank you!!


GK Gayathri KarunaiAnandam Syncfusion Team March 11, 2021 08:01 AM UTC

Hi Anderson, 

Sorry for the inconvenience. 

We have checked your reported query. We will update our documentation in our upcoming release. We appreciate your patience until then. 

Regards, 
Gayathri K 


Loader.
Live Chat Icon For mobile
Up arrow icon