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

onEventClicked don't work when switching page

Asked by Anonymous
8 years ago.

Hi, when i switch page, the onEventClicked don't work. I have to reload the page to make it work again. Is it a bug ?
There is my code :

$scope.schedulerConfig = {
scale: "Day",
days: 365,
startDate: new DayPilot.Date().firstDayOfMonth(),
timeHeaders: [
{ groupBy: "Month" },
{ groupBy: "Day", format: "d" }
],
treeEnabled: true,
onEventClicked: function(args) {
alert(args.e.id());
}
};

$timeout(function() {
loadResources();
loadEvents($scope.scheduler.visibleStart(), $scope.scheduler.visibleEnd());
});

function loadResources() {
var link = 'get_objet_planing.php';

$http.get(link).success(function(data) {
$scope.schedulerConfig.resources = data;
});
}

function loadEvents(from, to) {
var link2 = '/get_location.php';

$http.get(link2).success(function(data) {
$scope.schedulerConfig.startDate = from;
$scope.schedulerConfig.days = Math.floor(new DayPilot.TimeSpan(to.getTime() - from.getTime()).totalDays());
$scope.events = data;
});
}

Comment posted by Anonymous
8 years ago.

I will explain my problem. There is the code :

$scope.schedulerConfig.onEventClicked = function(args) {alert(args.e.id());};

When i'm on the scheduler page, it works fine. But when i go on an other page and go again on my scheduler page, it doesn't work. I have to reload the page to make it works again.

I'm french sorry for my english

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