Is it possible to sort the Resource grid?


I have a gantt with the main area and a resource table below.
I have enabled gant.config.sort and everything works as expected in the main area, but not in the resource table.

In that resource table I would like to sort either by person’s name or workload, the only two columns that exist.

Is that possible to achieve?

Thanks in advance!

Hello Ricardo,
Gantt doesn’t have that feature. The dev team will implement it in the future.
I cannot give you any ETA, but I will notify you when the sort in the resource chart feature is implemented.

Hi Ramil,
Many thanks for your response, no problem we’ll wait for it then.

In the meantime, would it be possible to sort on init, for instance after getting the person’s names and their workload, sort them by workload first and then add them to the resource table?

Thank you!

Hello Ricardo,
In our examples, the workload is not saved in the resource data, it is generated in the resource grid:

If you want to sort the resources according to the workload, you need to implement a custom solution.

However, you can sort the resource data by name and then parse the new resource data. Here is an example of how it might be implemented:

Hello Ramil,

Many thanks for your help!

I ended up using your snippet to sort by name, as I am also using your examples to build the resource grid.
For the workload it was a little more difficult, but it’s working:

  1. I build an array with names and workloads using jquery and the DOM
  2. Sort this array by workload
  3. Merge this array with my original resources array (I need other fields like id’s)
  4. Parse my resourcesStore with the new array