Our state of the art Gantt chart


Post by mrefaat »

check the project "WBS greater than 10 "
as shown in the attached image the tasks " sample 10" & " sample 11"
with wbs 10 & 11
but when rendered in the Gantt it gets wrong wbs which is 2 & 3

Attachments
wbs.PNG
wbs.PNG (115.27 KiB) Viewed 170 times

Post by Maxim Gorkovsky »

WBS code is calculated according to the position in the tree. The order in which you provide the data defines record WBS. If you want to provide WBS yourself, you can use manual mode https://bryntum.com/products/gantt/docs/api/Gantt/data/TaskStore#typedef-WbsMode


Post by mrefaat »

I tried wbsMode to be false for add and remove and this doesn't solve the problem.
The WBS i'm saving in salesforce is the one generated by Gantt and i'm retrieving the data sorted by WBS, but since it's a string the value 1.10.1 comes before 1.2

I think the Gantt should respect the wbs numbers that it generated originally


Post by mrefaat »

Is there a way to probably store the sort order from Gantt into salesforce and retrieve records later sorted by the sort number ?


Post by alex.l »

Hi,

Don't your response already have correct sorting when you load data? The solution is just to not re-sort after load, isn't it?

All the best,
Alex


Post by mrefaat »

I'm not resorting. You told me that the Gantt will take the items in the same order i' provided the data.
So i think we need to resort by WBS when loading the data. or i save the sort order in the database and order by it when loading the data ( preferably)

So i would need from you the filed name of the sort column or what will be the function for sorting on load


Post by mrefaat »

I prefer the option of sorting in the database as it's faster when we have larger datasets like 1000 tasks


Post by alex.l »

Hi

You told me that the Gantt will take the items in the same order i' provided the data.
So i think we need to resort by WBS when loading the data.

https://bryntum.com/products/gantt/docs/api/Gantt/model/TaskModel#field-wbsValue is calculated field. So, it will be calculated according to data order you sent from the server side. Not sure how do you need to re-sort after load?
If you saved wbsCode (set that field as persisted), change data order in another place and loaded data again, sort by wbsCode column. As I see in your screenshot, the problem you faced is not in our Grid? So, maybe just create proper sorting function in your column to parse wbsCode correctly? You're right, wbsCode is a String(since there is not built-in data type for numbers in format 1.1.1), so it's required extended sort method in your components.

Sorry if I missed something. I would glad to help you better if you'll describe your problem.

All the best,
Alex


Post by mrefaat »

Is there a field in the task store called sortOrder same like wbsCode which i can save in the database ?


Post by mrefaat »

I implemented a custom sort for WBS. It's working fine. we can close the ticket


Post Reply