Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
585
Can the igx-combo event onAddition be cancelled?
posted

We really like the implementation of igxComboAddItem, but we cannot find out the best way to make it work in our environment.

When a user requests that a new item be added to a lookup list, we fire an API request to validate the entry (i.e. not all spaces, not duplicate), ensure the user has the appropriate authority to perform the action, and then finally store it in the DB.

When the value is stored in the DB, it will have a numeric key generated which is needed to successfully add the entry to the list.

We can figure out how to perform this work in the onAddition method (we can do it synchronously if needed), but what we can figure out yet is how to cancel the add operation if one of the business rules fails in the API call.

One option might be to reset the new list of items and then update it when the operation has completed (this approach could also support async operations).

Another option might be to replace the addItem's click event when combo is opening.

Both of these options seem somewhat drastic, so we were hoping there was a better, standard way of doing this work.