Our state of the art Gantt chart


Post by tremel »

Hi Bryntum Team,

We would like to hide /show certain records from the Gantt chart. When using the task store's filter, we noticed that the records are not available to our internal processing logic as well. This is documented here https://bryntum.com/products/grid/docs/guide/Grid/data/storebasics#filtering

Is there a way to only visually hide them in the Gantt? Please advise what the correct approach would be in your opinion... Css magic would obviously work but is not a very proficient approach I would assume.

Best,
Andreas


Post by marcio »

Hey Andreas,

Thanks for reaching out.

You can try to use the following snippet, please check if it suits your needs. (You need to put it on root Gantt config object)

taskRenderer({ taskRecord, renderData }) {
        renderData.style.display = 'none'
    }

https://bryntum.com/products/gantt/docs/api/Gantt/view/GanttBase#config-taskRenderer

Best regards,
Márcio


Post by tremel »

Hi Márcio,

Just to confirm here: Would that hide the entire row (intended) or just the task bar?

Best,
Andreas


Post by marcio »

Hey Andreas,

Sorry, that's just for the taskbar.

Actually, the correct way to hide the entire row would be to use the filter function as you mentioned. But, for use with your internal logic, you can use https://bryntum.com/products/gantt/docs/api/Core/data/Store#property-allRecords which returns all the data without the filtering.

Is that a possible approach for you?

Best regards,
Márcio


Post by tremel »

Hey Márcio,

Bar is close, but not enough I'm afraid. Thanks for bearing with me!

We're extending your TaskModel with our own. There, we override methods, e.g. for start / end date calculation.

However, the when we access this.children on a filtered store, it returns the the subset, not all.

Any idea o how to get the unfiltered children's list on an overidden TaskModel? Using allRecords with a filter?

Best,
Andreas


Post by marcio »

Hey Andreas,

You can try https://bryntum.com/products/gantt/docs/api/Core/data/Store#function-getChildren, if that doesn't work, using allRecords with a filter should do the job for you.

Best regards,
Márcio


Post by tremel »

Hey Márcio,

I just found this['childEvents'] on the TaskModel which return unfiltered children. Is that also feasible or not recommended?

Best,
Andreas


Post by marcio »

Hey Andreas,

I'll confirm with your team if that's reliable. As it is not publicly documented, looks like something that we use internally and we cannot recommend the usage until the property is available on public documentation.

Best regards,
Márcio


Post by tremel »

Hey Márcio,

Thank you very much. Reason I prefer this['childEvents'] over this.taskStore: The store is undefined in some cases.

Appreciate your help!

Best,
Andreas


Post by marcio »

Hey Andreas,

I confirmed with the team and you can use:

store.getChildren(record, true)

and the second argument is the unfiltered property which is false by default (it's not documented yet, we'll have that fixed soon). https://github.com/bryntum/support/issues/9782

Best regards,
Márcio


Post Reply