About step 11 of the tutorial

In step 11 of the tutorial at https://webix.com/tutorials/intro/11, when you add a new film, you can click the “add” button multiple times and multiple items will be added into the list, each of them has different ids. How can I forbid this so that no duplicate items can be added?

Hello @tqr4deWKvuFp6J2Tu,

How can I forbid this so that no duplicate items can be added?

I can think of a few ways you could do this, but it really depends on the exact functionality you are looking for. For instance, if you want to check for duplicate “title” and “year” fields, you can use the find() method to see if any of the existing items match your criteria. In this case that would be: check if the new item’s fields match one of the already existing item’s fields.

The end result looks something like this: https://snippet.webix.com/e1bknzwq.

Thank you Dzmitry!