(function(){
var app = angular.module('sbi', ['ui.grid', 'ngDialog']);
var cmbStati = {};
app.config(['ngDialogProvider', function (ngDialogProvider) {
ngDialogProvider.setDefaults({
className: 'ngdialog-theme-default',
plain: false,
showClose: true,
closeByDocument: false,
closeByEscape: false,
appendTo: false,
preCloseCallback: function () {
console.log('default pre-close callback');
}
});
}]);
app.controller('PanelController', ['$scope', '$compile', 'uiGridConstants', 'ngDialog', function ($scope, $compile, uiGridConstants, ngDialog){
var actionTemplate = '<div class="ui-grid-cell-contents"><img class="addNotes" src="images/button/detail.gif" ng-click="grid.appScope.dettaglio(row, false)" /></div>';
$scope.dettaglio = function(row){
ngDialog.open({
template: 'dialog_sbi.html',
scope: $scope,
className: 'ngdialog-theme-default',
height: 400,
plain: true
});
};
$scope.highlightFilteredHeader = function( row, rowRenderIndex, col, colRenderIndex ) {
if( col.filters[0].term ){
return 'header-filtered';
} else {
return '';
}
};
$scope.gridOptions = {
enableFiltering: true,
onRegisterApi: function(gridApi){
$scope.gridApi = gridApi;
},
columnDefs: [
{ field: 'azioni', enableFiltering: false, width: 85, enableSorting: false, enableColumnMenu: false, cellTemplate: actionTemplate, displayName: 'Azioni'},
{ field: 'codeSubInstaller', headerCellClass: $scope.highlightFilteredHeader },
{ field: 'nomeSubInstaller', headerCellClass: $scope.highlightFilteredHeader },
{ field: 'cognSubInstaller', headerCellClass: $scope.highlightFilteredHeader },
{ field: 'codeFiscaleSubInstaller', headerCellClass: $scope.highlightFilteredHeader },
{ field: 'descStato' , headerCellClass: $scope.highlightFilteredHeader }
]
};
// $scope.listaOptions = cmbStati;
$scope.toggleFiltering = function(){
$scope.gridOptions.enableFiltering = !$scope.gridOptions.enableFiltering;
$scope.gridApi.core.notifyDataChange( uiGridConstants.dataChange.COLUMN );
};
$scope.filteredRows=[];
var data = {};
console.log("search");
var loadUrl = "/sky_visp/subinstaller/inserimento/dettaglio.do?methodName=doSearchNg";
$.ajax({
async: false,
url : loadUrl,
type: "POST",
data: data,
dataType: 'json',
cache: false,
complete: function(){
console.log("Nice search");
},
success : function (ritornoSearch, stato) {
console.log("Made it search");
console.log("ritornoSearch: "+ritornoSearch);
$scope.gridOptions.data = ritornoSearch;
},
error : function (richiesta, stato, errori) {
console.log("Nope search");
}
});
}]);
})();
When I attempt to open the HTML template within ngDialog.open, the dialog displays correctly, but instead of showing the content of the HTML page, it prints out the name of the file. How can I ensure that the HTML is opened properly in the dialog? I have tried using the full path, calling it with double quotes, and removing the single quotes.
I'm struggling to understand what I might be missing.
The issue persists despite my attempts at various solutions.