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

rows.filter() while onEventMoving()

Asked by Daniel
9 years ago.

Hi,

i want to filter the resources when the user drags an Event. But in the Moment when the resource-list is filterd, i cant move the Event and the console says "TypeError: DayPilotScheduler.moving.event is null".

dp.onEventMoving = function(args) {
args.left.enabled = true;
args.left.html = args.row.name;
args.right.enabled = false;

DayPilot.request("backend_einheitarten.php?id=" + id, function(result) {
var data = eval("(" + result.responseText + ")");
filterIds = data;

//resourcen-liste filtern
dp.rows.filter(filterIds);

});

};

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

Unfortunately it's not possible to use the filter in onEventMoving because the filter() method causes a refresh of the Scheduler (and it disrupts the current drag and drop operation).

Also calling an AJAX request in onEventMoving might be dangerous because this event can be fired many times in a short time. It's fired once for every location change during drag and drop.

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