October 23, 2020, 07:45:29 AM

See more Support incidents in our old archived forum.

Author Topic: SortOrder  (Read 3425 times)

magnus.sundstrom

  • Customers
  • Newbie
  • *
  • Posts: 7
SortOrder
« 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?

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 149
Re: SortOrder
« Reply #1 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.

magnus.sundstrom

  • Customers
  • Newbie
  • *
  • Posts: 7
Re: SortOrder
« Reply #2 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.

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 149
Re: SortOrder
« Reply #3 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.