0
我的文檔中發現DAT,我們可以從調度到數據庫使用該發送數據:無法保存使用DHTMLX調度,數據處理器數據,數據庫和angularjs
var dp = new dataProcessor(url)
dp.init(myobj)
編輯 我不當我將這些代碼行放在代碼的$ watch-part內時,就會有一個無限循環。但它仍然不會將任何內容保存到數據庫中。
myAppProfile.directive('dhxScheduler', function() {
return {
restrict: 'A',
scope: false,
transclude: true,
template:'<div class="dhx_cal_navline" ng-transclude></div><div class="dhx_cal_header"></div><div class="dhx_cal_data"></div>',
link:function ($scope, $element, $attrs, $controller){
//default state of the scheduler
if (!$scope.scheduler)
$scope.scheduler = {};
$scope.scheduler.mode = $scope.scheduler.mode || "month";
$scope.scheduler.date = $scope.scheduler.date || new Date();
//watch data collection, reload on changes
$scope.$watch($attrs.data, function(collection){
if(collection) {
scheduler.clearAll();
scheduler.parse(collection, "json");
//this does not cause infinite loop but does not work either
var dp = new dataProcessor("agendaController.php");
dp.init(scheduler);
}
}, true);
//watch mode and date
$scope.$watch(function(){
return $scope.scheduler.mode + $scope.scheduler.date.toString();
}, function(nv, ov) {
var mode = scheduler.getState();
if (nv.date != mode.date || nv.mode != mode.mode)
scheduler.setCurrentView($scope.scheduler.date, $scope.scheduler.mode);
}, true);
//size of scheduler
$scope.$watch(function() {
return $element[0].offsetWidth + "." + $element[0].offsetHeight;
}, function() {
scheduler.setCurrentView();
});
//styling for dhtmlx scheduler
$element.addClass("dhx_cal_container");
//init scheduler
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.init($element[0], new Date(), "month");
scheduler.load("agendaController.php", "json");
//This gave infinite loop
//var dp = new dataProcessor("agendaController.php");
//dp.init(scheduler);
}
}
});
這是我的控制器代碼:
RangeError: Maximum call stack size exceeded at Object.dataProcessor.init [as init_original]
誰能幫助我瞭解如何開始節能活動,以分貝:
include('connections.php');
include('/db-connector/scheduler_connector.php');
$scheduler = new JSONSchedulerConnector($conn);
$scheduler->render_table("events","id","start_date,end_date,text");
,我在控制檯得到的是錯誤?謝謝!