RadiantQ jQuery Gantt Package
How to add a new resource in resource dataset without reloading Gantt?
Previous Topic  Next Topic 


Add a new resource to the ResourceItemsSource using the "ganttControl.AddNewResourceItem" method. Here is the code that illustrates how to add a new resource in resource dataset in button click at runtime.


$(document).ready(function () {

            ................

            ................

    var ganttControl = $gantt_container.data("GanttControl");

    var resourceItemsSource = ganttControl.options.ResourceItemsSource;

    var count = resourceItemsSource.length;

    $("#addResources").click(function () {

        count++;


        var resourceData = {

            ResourceID: count,

            ResourceName: "Resource " + count

        };

        // Adding resource at run time.

        ganttControl.AddNewResourceItem(resourceData);

    });


});

           









� RadiantQ 2022. All Rights Reserved.