student view pdf done

This commit is contained in:
gandhimathi 2018-03-15 12:09:27 +05:30
parent 0f65c62316
commit 4c618df65c

View File

@ -4,13 +4,13 @@
* Simple table with sorting and filtering on AngularJS
*/
app.controller('studentViewCtrl', ["$scope","$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", function ($scope,$rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state) {
app.controller('studentViewCtrl', ["$scope","$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", "$modal", "$log", function ($scope,$rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, $modal,$log) {
/*
* used to get student course details
* this method called from view ng-init directive
* created by kms
* */
$rootScope.studentAllDetails
$scope.getStudentDetails = function () {
var getcourse = {
method: 'POST',
@ -26,6 +26,7 @@ app.controller('studentViewCtrl', ["$scope","$rootScope", "toaster", "$filter",
$http(getcourse).then(function (response) {
if (response.data.status == 200 && response.data.studentStatus== true) {
$rootScope.studentAllDetails = response.data;
$scope.studentDetails = response.data.studentDetails;
$scope.courseDetails = response.data.courseDetails;
@ -33,11 +34,40 @@ app.controller('studentViewCtrl', ["$scope","$rootScope", "toaster", "$filter",
} else {
$scope.studentDetails = "";
$scope.courseDetails = "";
$rootScope.studentAllDetails="";
}
});
};
$scope.printStudentDetails = function (details) {
$rootScope.pdfItems = details;
var modalInstancePrint = $modal.open({
templateUrl: 'assets/views/student/studentViewPdf.html',
controller: 'studentViewCtrl',
// size: size,
resolve: {
list: function () {
return details;
}
}
});
modalInstancePrint.result.then(function (selectedItem) {
$scope.selected2 = selectedItem;
}, function () {
$log.info('Modal dismissed at: ' + new Date());
});
};
// generate pdf for student view
$scope.export = function(getName) {
kendo.drawing.drawDOM($("#exportthis")).then(function(group) {
kendo.drawing.pdf.saveAs(group, getName+".pdf");
});
}
}]);