Hi,
In my project I’m using AngularJS webix (frontend) and Symfony2(backend, api).
Somehow everything that I do renders twice and executes twice. for example:
This is my AngularJS controller:
ifes.controller("DataEntryController", ['$scope', '$http', '$state', 'CookieService', function ($scope, $http, $state, CookieService) {
webix.attachEvent("onBeforeAjax", function(mode, url, data, request, headers){
headers["Authorization"]= CookieService.get('token');
headers["Content-type"]= "application/json";
});
$scope.addCaseAction = function () {
$state.go("dataentryaddcase");
};
$scope.dataentry = {
isolate:true,
view: "tabview",
cells: [
{
header: "Complains",
body: {
rows: [
{
view:"datatable",
autoheight:true,
autoConfig:true,
scroll:false,
url: "rest->/app_dev.php/api/secure/cases",
id: "listView",
on:{
onBeforeLoad:function(){
this.showOverlay("Loading...");
},
onAfterLoad:function(){
this.hideOverlay();
}
},
columns:[
{ id:"action", header:"Action",template:"<a href='#'>Update</a> | <a href='#'>View</a> | <a href='#'>View Correspondeces </a>",adjust:true},
{ id:"case_number", header:"Case",adjust:true},
{ id:"plaintiff_complainant_name", header:"Complaint",adjust:true },
{ id:"typeofcomplaint", header:"Type of Complaint", map:"#phase_electoral_proccess.name#", fillspace:true},
{ id:"received_on", header:"Submission Date",fillspace:true},
{ id:"dead", header:"Adjudicaton Deadline",map:"#decision.fines[0].deadline#",fillspace:true},
{ id:"case_status", header:"Status", map: "#case_status.name#", adjust:true},
{ id:"edit", header:"Edit",template:"<a href='#'>{common.editIcon()}</a>",adjust:true},
],
pager:{
size:1,
group:5
}
},
{
view: "toolbar",
id:"toolbarr",
cols:[
{ view:"button", value:"Add New Case", width:200, align:"right",click:"addCaseAction" }
]
}
]
}
},
And this is my app config:
ifes.config( ['$stateProvider', '$urlRouterProvider', '$resourceProvider', '$httpProvider', 'USER_ROLES', function($stateProvider, $urlRouterProvider, $resourceProvider, $httpProvider, USER_ROLES) {
$httpProvider.interceptors.push('authorizationInterceptor');
$urlRouterProvider.otherwise('/login');
})
.state('dataentry', {
url: '/dataentry/home',
templateUrl: 'app/views/data_entry_officers/home.html',
access: {
isPublic: false,
requiredRoles: [USER_ROLES.data_entry_officers]
}
})
This is view :
div ng-controller="DataEntryController as dataentry"
div webix-ui="dataentry" webix-ready="dataentryconfig(root)"
When my datatable shows view will execute twice (for example pager will be shown twice) and every ajax call will be duplicated (in my case url: “rest->/app_dev.php/api/secure/cases” will be duplicated). I’m searching for days for the solution but I couldn’t find one. If you have any idea what is going wrong I will appreciate.
PS: I’m sorry I forgot to explain this happens to me only when I integrate Webix into AngularJS
Thank you