Our state of the art Gantt chart


Post by shaveta »

Hi,

In the advanced gantt example https://www.bryntum.com/examples/gantt/advanced/, Task Labels, Highlight now working time etc. are marked as "checked:false" but in features these are marked as checked as shown in attached screenshot. Is there anything wrong or i am misunderstanding?

err.png
err.png (216.46 KiB) Viewed 708 times

Post by mats »

Small demo bug yes, now fixed!


Post by shaveta »

mats wrote: Tue Nov 17, 2020 9:41 am

Small demo bug yes, now fixed!

Thanks Mats!! Can you please share fix with me so that i can apply in my code too?


Post by mats »

It's just a matter of setting initial value to true in the demo as labels are on by default.


Post by shaveta »

mats wrote: Tue Nov 17, 2020 11:39 am

It's just a matter of setting initial value to true in the demo as labels are on by default.

Sorry Mats!! i didn't understand where do i need to set initial value to true, Can you please clarify more


Post by mats »

You yourself posted the code where it is wrong, scroll up and look at the code - then change the boolean values to reflect the initial state of your app


Post by shaveta »

mats wrote: Tue Nov 17, 2020 5:48 pm

You yourself posted the code where it is wrong, scroll up and look at the code - then change the boolean values to reflect the initial state of your app

If i am changing those Boolean values it's not reflecting :( i am using gantt-4.0.0


Post by mats »

This is the code executed before the features menu is shown, keeps everything up to date:

onFeaturesShow({ source : menu }) {
        const { gantt } = this;

    menu.items.map(item => {
        const { feature } = item;

        if (feature) {
            // a feature might be not presented in the gantt
            // (the code is shared between "advanced" and "php" demos which use a bit different set of features)
            if (gantt.features[feature]) {
                item.checked = !gantt.features[feature].disabled;
            }
            // hide not existing features
            else {
                item.hide();
            }
        }
        else {
            item.checked = gantt.subGrids[item.subGrid].collapsed;
        }
    });
}

Post Reply