RadiantQ jQuery Gantt Package
How to insert/remove items dynamically?
Previous Topic  Next Topic 

We recommend you to add or remove items in FlexyGantt items using "$.observable" utility to let Gantt to update those changes immediately.


Available methods of $.observable


To insert the item into the data at the end. This is equivalent of push method in array.

To insert the item into the given index in data.

To remove the item at the given index in data.


Here is the code usage,


// Inserting new Team at the index of 1.

$.observable(jsonData).insert(1/*Index to insert*/, newTeam);

// Inserting new Resource at the index of 1.

$.observable(jsonData[0].Resources).insert(1/*Index to insert*/, newResource);

// Inserting new Task at the end of items.

$.observable(jsonData[0].Resources[0].Tasks).insert(1/*Index to insert*/, newTask);



// Removing Team at the index of 1.

$.observable(jsonData).remove(1/*Index to remove*/);

// Removing Resource at the index of 1.

$.observable(jsonData[0].Resources).remove(1/*Index to remove*/);

// Removing Task at the index of 0.

$.observable(jsonData[0].Resources).remove(0/*Index to remove*/);





© RadiantQ 2022. All Rights Reserved.