How to add rows dynamically in kendo gantt chart?

438 Views Asked by At

I need to add rows to Kendo Gantt chart dynamically (somewhat like add new task). I am adding the new row to dataSource, but the newly added row is not reflecting in the UI. I tried refreshing the gantt chart, but no luck. Adding k-rebind works, but I do not want to go with k-rebind option.

plunker: http://plnkr.co/edit/D5TZlsrUS9XX2nV6WOFe?p=preview

function injectRow() {
    $scope.myGanttOptions = ganttServices.injectRow($scope.myGanttOptions);
    console.log($scope.myGanttOptions); //$scope.myGanttOptions is having the newly injected row, but it is not seen in the UI.

    //  refreshing the gantt chart does not inject the row.(even after trying it in timeout)
    $timeout(function() {
        $('#ganttID').getKendoGantt().dataSource.read();
        $('#ganttID').getKendoGantt().refresh();
    },100);
}
0

There are 0 best solutions below