Premium support for our pure JavaScript UI components


Post by pincherhgz »

we cannot find a configuration that switches the resources to the collapsed view instead of the expanded view on startup

Attachments
ungrouped.jpg
ungrouped.jpg (175.93 KiB) Viewed 370 times
grouped.jpg
grouped.jpg (57.98 KiB) Viewed 370 times

Post by mats »

You mean you would like all groups to start collapsed?


Post by pincherhgz »

yes


Post by alex.l »

All the best,
Alex


Post by pincherhgz »

we did now the collapsing after waiting for the project data to be ready by

project.commitAsync();

but this results in no histogram data painted. We have to wait until all the histogram is rendered before doing the collapse. This is really a strange behaviour


Post by arcady »

Could you give more details on how we can reproduce this? Like steps allowing to see this on some of our demos or a test case.


Post by Animal »

arcady wrote: Fri Apr 28, 2023 7:11 am

Could you give more details on how we can reproduce this? Like steps allowing to see this on some of our demos or a test case.

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.


Post by pincherhgz »

this hint works fine for us now:

resourceStore : {
        startGroupsCollapsed : true
    }

Post Reply