I'm working on some application wherin the data will be displayed based on some selection. The data will be selected from the table as shown in the screenshot. It gets populated in the table through some JSON.
Now, lets say, for example,
Select A & C from the table shown in the screenshot and click on 'Save'.
A & C get appended to "div.box" with ids "parent-0" and "parent-1" respectively.
Now, select A & B from the table.
Current situation: Nothing is added, and alert is shown as "Data already exists!" Ideal behaviour: B should get appended to "div.box" with id "parent-2" and alert should be shown as "A already exists!".