How to Filter Task that has ShowInTimeLine set to true

Show cool things you have done with our products
Post Reply
User avatar
VinceBlood
Posts: 7
Joined: Tue May 03, 2016 8:20 pm

How to Filter Task that has ShowInTimeLine set to true

Post by VinceBlood » Fri Mar 01, 2019 2:26 pm

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 :

Code: Select all

onFilterTasks : function () {
        this.getGantt().taskStore.filterTreeBy(function (task) {
            return task.getDuration() >= 10;
        });
    },
This code doesn't work properly :

Code: Select all

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".

User avatar
mats
Core Developer
Core Developer
Posts: 14554
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: How to Filter Task that has ShowInTimeLine set to true

Post by mats » Fri Mar 01, 2019 7:33 pm

It works fine for me in advanced demo:

Code: Select all

Ext.first('ganttpanel').taskStore.filterTreeBy(function (task) {
            return task.getShowInTimeline();
        });
As for 2nd question, please provide more details.
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

User avatar
VinceBlood
Posts: 7
Joined: Tue May 03, 2016 8:20 pm

Re: How to Filter Task that has ShowInTimeLine set to true

Post by VinceBlood » Sun Mar 03, 2019 4:15 pm

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)

User avatar
mats
Core Developer
Core Developer
Posts: 14554
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: How to Filter Task that has ShowInTimeLine set to true

Post by mats » Mon Mar 04, 2019 11:09 am

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.
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

User avatar
VinceBlood
Posts: 7
Joined: Tue May 03, 2016 8:20 pm

Re: How to Filter Task that has ShowInTimeLine set to true

Post by VinceBlood » Tue Mar 05, 2019 2:40 pm

I don't know why but now the function works !

Code: Select all

return task.getShowInTimeline();
filters columns.

I have however a two missing tasks that should appears :

The complete list :
Capture 1.png
Capture 1.png (50.12 KiB) Viewed 457 times
Filter by ShowInTimeLine, the Task "Commande matériel" is missing
Capture 2.png
Capture 2.png (30.99 KiB) Viewed 457 times
I joined the json data.
Attachments
json_data.txt
(74.45 KiB) Downloaded 22 times

User avatar
pmiklashevich
Core Developer
Core Developer
Posts: 2242
Joined: Fri Apr 01, 2016 11:08 am

Re: How to Filter Task that has ShowInTimeLine set to true

Post by pmiklashevich » Thu Mar 07, 2019 7:34 pm

Code: Select all

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

User avatar
VinceBlood
Posts: 7
Joined: Tue May 03, 2016 8:20 pm

Re: How to Filter Task that has ShowInTimeLine set to true

Post by VinceBlood » Fri Mar 08, 2019 10:57 am

Thank you very much, it works perfectly!

Post Reply