Show cool things you have done with our products


Post by VinceBlood »

I'm using the Advanced Gantt Example.

I don't understand how make a filter on the ShowInTimeLine column

app/view/MainViewportController.js

This code works correctly :
onFilterTasks : function () {
        this.getGantt().taskStore.filterTreeBy(function (task) {
            return task.getDuration() >= 10;
        });
    },
This code doesn't work properly :
onFilterTasks : function () {
        this.getGantt().taskStore.filterTreeBy(function (task) {
            return task.getShowInTimeline();
        });
    },
It seems that the TaskStore doesn't accept bolean value as entry but only text value.



A second question is how to make a FilterColumn like the example "app\filed\Filter.js". I would like to display a list of possible value "True or False".

Post by mats »

It works fine for me in advanced demo:
Ext.first('ganttpanel').taskStore.filterTreeBy(function (task) {
            return task.getShowInTimeline();
        });
As for 2nd question, please provide more details.

Post by VinceBlood »

I'm using Gantt 4.1.3, maybe there is an issue on this version ?

For the 2nd question :

I would like to change the "input field" by several option :
- a special Date filter like EXCEL to manage Date column (startdate, enddate, contraintdate). On excel when you have a date column you can apply a filter that allow you to click/unclick by year/month/day
- a list with yes/no to manage checkbox column (showtimeline)

Post by mats »

Possibly, try upgrading to latest?

#2. Sounds like you just have to build a custom UI using the standard Ext JS classes. Look at TextField, Combo, Panel, Picker etc and you'll find all the pieces you need.

Post by VinceBlood »

I don't know why but now the function works !
return task.getShowInTimeline();
filters columns.

I have however a two missing tasks that should appears :

The complete list :
Capture 1.png
Capture 1.png (49.95 KiB) Viewed 7425 times
Filter by ShowInTimeLine, the Task "Commande matériel" is missing
Capture 2.png
Capture 2.png (30.89 KiB) Viewed 7425 times
I joined the json data.
Attachments
json_data.txt
(72.29 KiB) Downloaded 330 times

Post by pmiklashevich »

Ext.first('ganttpanel').taskStore.filterTreeBy({
    filter       : function (task) {
        return task.getShowInTimeline();
    },
    checkParents : true
});
Please see docs: https://www.bryntum.com/docs/gantt-for- ... lterTreeBy

Pavlo Miklashevych
Sr. Frontend Developer


Post by VinceBlood »

Thank you very much, it works perfectly!

Post Reply