bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
53 stars 6 forks source link

Resource Histogram should support summary and group summary features #2283

Open pmiklashevych opened 3 years ago

pmiklashevych commented 3 years ago

Requested here: https://www.bryntum.com/forum/viewtopic.php?p=81818#p81818

SchedulerPro/examples/resourcehistogram/app.js

import '../../lib/Scheduler/feature/GroupSummary.js';
.....
const histogram = window.histogram = new ResourceHistogram({
    features : {
        group        : 'city',
        groupSummary : {
            collapseToHeader : true,
            renderer({ events }) {
                return `<label>${events.length || ''}<label>`;
            }
        }
    },

Also should support zooming in/out.

GroupSummary.js:128 Uncaught TypeError: Cannot read property 'on' of undefined
    at GroupSummary.construct (GroupSummary.js:128)
    at GroupSummary.featureClass.construct (GridFeatures.js:208)
    at new Base (Base.js:364)
    at new Events (Events.js:199)
    at new Localizable (Localizable.js:26)
    at new InstancePlugin (InstancePlugin.js:47)
    at new SummaryFormatter (SummaryFormatter.js:12)
    at new GroupSummary (GroupSummary.js:29)
    at new GroupSummary (GroupSummary.js:34)
    at Object.get (GridFeatures.js:213)
DomSync.js:180 Uncaught (in promise) TypeError: Cannot read property 'lastDomConfig' of undefined
    at Function.performSync (DomSync.js:180)
    at Function.sync (DomSync.js:148)
    at HorizontalRendering.onRenderDone (HorizontalRendering.js:1459)
    at RowManager.trigger (Events.js:1131)
    at RowManager.renderRows (RowManager.js:976)
    at HorizontalRendering.js:907
    at ResourceHistogram.runWithTransition (TimelineBase.js:1645)
    at HorizontalRendering.refreshResources (HorizontalRendering.js:902)
    at HorizontalRendering.onProjectRefresh (HorizontalRendering.js:355)
    at ProjectModel.trigger (Events.js:1131)

Replacing scheduler.eventStore with scheduler.project.eventStore helps with the first failure But then it fails while zooming and it doesn't show summary row first time before refresh

Снимок экрана 2021-01-25 в 18 25 35
Uncaught Error: Currently no support for transforming nodeType
    at Function.syncChildren (DomHelper.js:2015)
    at Function.performSync (DomHelper.js:1822)
    at Function.syncChildren (DomHelper.js:2000)
    at Function.performSync (DomHelper.js:1822)
    at Function.syncChildren (DomHelper.js:2000)
    at Function.performSync (DomHelper.js:1822)
    at Function.syncChildren (DomHelper.js:2000)
    at Function.performSync (DomHelper.js:1822)
    at Function.sync (DomHelper.js:1811)
    at GroupSummary.updateSummaryHtml (GroupSummary.js:206)
arcady-zherdev commented 3 years ago

Grouping support is added in https://github.com/bryntum/support/issues/2608. But GroupSummary feature support is not added yet and will be done in this ticket

thijs4ef commented 2 years ago

Are there any updates on this issue?

arcady-zherdev commented 2 years ago

Not yet we've just added Grouping feature support in another ticket.

thijs4ef commented 2 years ago

Ah ok, do you know when this issue will be solved?

thijs4ef commented 2 years ago

Are there any updates on this issue 🙂?

arcady-zherdev commented 1 month ago

@thijs4ef Hello. It's looks almost fixed as far as I see. I've just tested it in v6.0.2 and there is no exception and it looks working after I registered the feature for the histogram base class:

import GroupSummary from '../../lib/Scheduler/feature/GroupSummary.js';
import GridFeatureManager from '../../lib/Grid/feature/GridFeatureManager.js';

// add the feature to the histogram class before using it
GridFeatureManager.registerFeature(GroupSummary, false, 'ResourceHistogram');

const histogram = new ResourceHistogram({
    features : {
        group : 'city',
        groupSummary : {
            collapseToHeader : true,
            renderer({ events }) {
                debugger
                return `<label>${events.length || ''}<label>`;
            }
        }
    },

Please check and let us know if that workaround for you.