Attach onAfterSelect to webix richselect

Can we attach onAfterSelect eventto webix richselect?

Hello @pratikshadatir1,

Yes, it it possible to do so. In order to do this, you will have to fetch the list component from within the richselect suggest view, which will then enable you to attach the appropriate event (onAfterSelect) to it.

That said, is there any reason why you don’t use the onChange event of the richselect control instead? The end result is virtually the same, but the code becomes less obfuscated.

Either way, here is an example featuring both events: https://snippet.webix.com/pml7g3fc. As you can see, they both return the same result (selected item’s id).

I am going to open window on change of value in richselect, but suppose I select same value again means according to your snippet suppose I select banana, one window will get open and suppose I again select banana window will not get open. but I want window to be opened once I select item either value in richselect changed or not. And for each option there will be different window.

In this case you should use an onItemClick event instead, which will trigger on every click, whether the item was selected or not : https://snippet.webix.com/byv0jed6.

OK. Thank you