I have the javascript version of DayPilot for which I am loading the resources by an ajax call.
<script type="text/javascript">
$(function () {
var data = $.post('/Schedules/GetVenuesAndRooms', function (data) {
dp.resources = data;
dp.update();
});
});
var dp = new DayPilot.Scheduler("dp");
dp.treeEnabled = true;
dp.startDate = new Date().toJSON().slice(0, 10);
The output from the ajax call looks like:
[{"id":11,"name":"Dublin - EIRE","children":[]},{"id":24,"name":"My Venue","children":[]},{"id":25,"name":"Graham's House","children":[{"id":0,"name":"My Front Room"}]}]
The problem I have is that the main venues show but if there are any children then I want them to be expanded by default but they are collapsed. I thought that setting the treeEnabled property would expand them but perhaps it is due to the way I am loading the data?