如何在kendo甘特图中动态添加行?

时间:2017-02-24 12:08:34

标签: angularjs kendo-ui telerik kendo-gantt

我需要动态地向Kendo Gantt图表添加行(有点像添加新任务)。 我将新行添加到dataSource,但新添加的行未反映在UI中。我尝试刷新甘特图,但没有运气。添加k-rebind有效,但我不想使用k-rebind选项。

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 个答案:

没有答案