we cannot find a configuration that switches the resources to the collapsed view instead of the expanded view on startup
Support Forum
Hi,
There is no such property now, I've opened a feature request for your request https://github.com/bryntum/support/issues/6642
You can try to use https://bryntum.com/products/gantt/docs/api/Grid/feature/Group#function-collapseAll when project's data is ready https://bryntum.com/products/gantt/docs/api/Gantt/model/ProjectModel#event-dataReady
All the best,
Alex
Just configure our SchedulerPro/resorcehistogram example like this:
const project = window.project = new ProjectModel({
transport : {
load : {
url : 'data/data.json'
}
},
autoLoad : true,
// This config enables response validation and dumping of found errors to the browser console.
// It's meant to be used as a development stage helper only so please set it to false for production systems.
validateResponse : true,
resourceStore : {
startGroupsCollapsed : true
}
});
const scheduler = new SchedulerPro({
appendTo : 'container',
minHeight : '10em',
flex : '1 1 50%',
startDate : new Date(2020, 3, 26),
endDate : new Date(2020, 4, 10),
viewPreset : 'dayAndWeek',
eventStyle : 'plain',
tickSize : 70,
resourceImagePath : '../_shared/images/users/',
columns : [
{ type : 'resourceInfo', text : 'Name', field : 'name', width : 130 },
{ text : 'City', field : 'city', width : 90 }
],
project,
features : {
group : {
field : 'city'
}
}
});
It makes sense that both widgets start collapsed. The Resource Store actually only contains the group header records. Collapsing actually removes the group child records from the store, so the histogram has no access to the data.
So expand and collapse signals have to be shared between partnered Schedulers. They share one store, so must show the same data in the same expanded/collapsed state.
But attempting to expand one of the collapsed groups throw an error.