RadiantQ Forum

Product => jQuery Gantt Package => Topic started by: magnus.sundstrom on November 24, 2014, 04:45:47 PM

Title: SortOrder
Post by: magnus.sundstrom on November 24, 2014, 04:45:47 PM
We just upgraded from 4.22 to 4.5 and noticed the task.SortOrder property is gone?? :o So how do we save position now?
Title: Re: SortOrder
Post by: Rajagopal on November 24, 2014, 05:37:24 PM
Magnus,

The SortOrder property is not removed in the 4.5 revision. Did you face any error in the latest version because of SortOrder or SortOrder is not working for you in the latest version?


Regards,
-Raja.
Title: Re: SortOrder
Post by: magnus.sundstrom on November 25, 2014, 07:31:09 AM
Well SortOrder is simply no longer part of the task object. We run JSON.stringify(tasks.asArray) when saving and it's not in there.
Title: Re: SortOrder
Post by: Rajagopal on November 25, 2014, 04:46:26 PM
Magnus,

Now we understand the issue. Previously we had a default SortOrderBinding defined in our source, but this was undesirable in some scenarios and so we are not setting a default SortOrderBinding. So, with the latest version, you can set the SortOrderBinding like this:
Code: [Select]
    $gantt_container = $('#gantt_container');
    $gantt_container.GanttControl({
        DataSource: tasks,
        GanttTableRowLoadedCallBack: templateCallBack,
        IDBinding: { Property: "ID" },
        StartTimeBinding: { Property: "StartTime" },
        EffortBinding: { Property: "Effort" },
        SortOrderBinding: { Property: "SortOrder" }
        .....
    });

This will continue to set the SortOrder values on the task objects when tasks are moved around.


Regards,
-Raja.