Premium support for our pure JavaScript UI components


Post by ofirk »

Hello, im trying to implement the tree feature with flat dataset but it does not work.
I used your simple react example with the following modifications:

in the scheduler.js file i added

        resourceStore: {
          tree: true,
          transformFlatData: true,
        },

to the config object.

and in the json file i changed one of the resources to have 'parentId' field with the value of another item.

{
        "id"        : "a",
        "name"      : "Arcady",
        "role"      : "Core developer",
        "important" : false
      },
      {
        "id"        : "b",
        "name"      : "Dave",
        "role"      : "Tech Sales",
        "parentId"  : "a",
        "important" : false
      },

see attached code example.
what am i missing?

thanks.

Attachments
tree-view.7z
(1.82 MiB) Downloaded 16 times

Post by mats »

What's the result you are seeing? Are you adding the Tree feature too?


Post by ofirk »

the result is a gantt without tree structure in the resource column,
yes i added the feature, please see the example i attached.


Post by tasnim »

Hi,

First of all, you'd need to put the resourceStore config inside of the crudManager config

        crudManager : {
            autoLoad  : true,
            resourceStore: {
                tree: true,
                transformFlatData: true,
            },
            transport : {
                load : {
                    url : 'data/data.json'
                }
            }
        },

And then you'd need to enable tree feature for scheduler

        treeFeature : true,

And now you should be good to go.

https://bryntum.com/products/scheduler/docs/api/Grid/feature/Tree

Best of luck :),
Tasnim

Attachments
msedge_WstjOMuSyk.gif
msedge_WstjOMuSyk.gif (262.9 KiB) Viewed 200 times

Post by ofirk »

Thanks, that worked!

Another question...
In the tree example https://bryntum.com/products/scheduler/examples/tree/ every node that has child leaf nodes in the resource column has a summary task in the Gantt row.
is there a feature of the Gantt to generate those automatically?

Attachments
Screenshot 2024-03-28 121718.png
Screenshot 2024-03-28 121718.png (48.14 KiB) Viewed 198 times

Post by tasnim »

Hi,

every node that has child leaf nodes in the resource column has a summary task in the Gantt row.

Not sure I got your question, could you please explain a bit further about your use case?


Post by ofirk »

Is it possible to have a row with summary tasks generated automatically as i outlined in the attached image?


Post by ofirk »

To further explain my use case, in your tree example there's a parent resource row "Gates 1-5" that shows an aggregation or summary of the events in the gantt for the child resources/rows beneath it.
My question is, is there a feature of the gantt that could generate that summary (blue events) automatically based on the events in the child resources?


Post by tasnim »

Hi,

The one you outlined in the image, that is not sumarry bars those are events assigned to Gates 1 - 5 resource. And we are modifying it inside of the eventRenderer

I'd recommend you to check the source code of the demo to understand how it is made.
You can check it by clicking on the code icon on the top left corner


Post by ofirk »

Hi, i see now you did not understand my question, perhaps im not explaining myself correctly, apologies.
I understand very well these are events assigned to "gates 1-5" resource, BUT if you'll notice these events are a summary in time of the child events, and as such they are also being named "summary" in the data.json file.
each summary task starts at the time of the first child event start time and end at the last child event end time.
My question is if the Gantt has a feature to AUTOMATICALLY deduce these summary events from the child events.


Post Reply