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;
});
}