search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Reorder resources?

Asked by AIMS
5 years ago.

Is it possible to reorder resources at the scheduler in javascript ? or move multiple resources at once like drag n drop for one?

Answer posted by Dan Letecky [DayPilot]
5 years ago.

The drag and drop row moving (https://doc.daypilot.org/scheduler/row-moving/) allows moving one row at a time. It will move the selected row, including all children.

You can also change the resources tree using the API - just modify the hierarchy using "resources" property and call update().

If you have a flat list of resources you can easily use Array.prototoype.splice() to remove the row from the old location:

var row = dp.rows.find("A");
var index = dp.resources.indexOf(row.data);
dp.resources.splice(index, 1);

And insert it at the new location:

var insertBeforeRow = dp.rows.find("C");
var index = dp.resources.indexOf(insertBeforeRow.data);
dp.resources.splice(index, 0, row.data);

For complex tree structures, it might be easier to make the change on the server side and reload all the resource data.

See also: https://forums.daypilot.org/Topic.aspx/4304/move-resoources

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.