gantt
gantt copied to clipboard
Can't seem to find a way to enable view mode
Hi, i'm trying out gantt chart in my angular app but i can't seem to get the view mode to display as attached, only the gantt displayed.
Please help.
Drop this below the gantt target div:
<div class="btn-group" role="group">
<button type="button" class="btn btn-sm btn-light">Quarter Day</button>
<button type="button" class="btn btn-sm btn-light">Half Day</button>
<button type="button" class="btn btn-sm btn-light">Day</button>
<button type="button" class="btn btn-sm btn-light active">Week</button>
<button type="button" class="btn btn-sm btn-light">Month</button>
</div>
...and into your JS...
gantt_chart.change_view_mode('Week');
$('.btn-group').on('click', 'button', function() {
$btn = $(this);
var mode = $btn.text();
gantt_chart.change_view_mode(mode);
$btn.parent().find('button').removeClass('active');
$btn.addClass('active');
});
This is only for the demo - not part of the framework.