Our state of the art Gantt chart


Post by bharat95 »

Hello bryntum,

I want to filter the records based on the type of the row. Look at the image below.

Del-Act.PNG
Del-Act.PNG (10.24 KiB) Viewed 161 times

The one in red is like a parent and the others in green are its children.
I want to filter them based on parent/child. I'm already using the filtering functionality from bryntum. Below is the code for that.

gantt.current.instance.tbar.add([
        {
          type: 'button',
          ref: 'filterAllButton',
          icon: 'b-gantt-filter',
          tooltip: 'Filter',
          menu: {
            pickergroup: {
              grid: gantt.current.instance,
              type: 'gridfieldfilterpickergroup',
              // fields: [
              //   { name: 'name', type: 'string', text: 'Name' },
              //   { name: 'owner', type: 'string', text: 'Owner' },
              //   { name: 'function', type: 'string', text: 'Function' },
              // ],              
}, }, }, ]);

So I want to include a one more property called 'type' and the values for it are should be parent/child.
Is this possible, please suggest.

Thanks,
Bharat.


Post by mats »

Please explain a bit further. Are you looking to filter out parents completely and only show children? We do not support this I'm afraid. Filtering out children is ok, but a child will always show its parent(s) too.


Post by bharat95 »

Hi mats,

Actually I want to add one more filter called 'type' and when I select type of parent rows in the filter, it should only show parent rows(red ones in my attachment) and same with the child(Should only show the children).
Actually till now whatever the filters I have added(E.g. Name, Function, Status etc) are column based. But I don't have type column in my gantt. Is there any way to achieve that filtration? Hope this info gives better clarity.

Thanks,
Bharat.


Post by alex.l »

Hi Bharat,

As Mats said

Are you looking to filter out parents completely and only show children? We do not support this I'm afraid

But if you want to know if it's parent or children, you can check in you filter method on a record
https://bryntum.com/products/gantt/docs/api/Core/data/mixin/TreeNode#property-isLeaf
https://bryntum.com/products/gantt/docs/api/Core/data/mixin/TreeNode#property-isParent
https://bryntum.com/products/gantt/docs/api/Core/data/mixin/TreeNode#property-childLevel

All the best,
Alex


Post Reply