Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('app')
- .controller('gradeLevelCtrl', ['$scope', '$state', '$mdDialog', '$timeout', '$q', '$log', '$filter', 'DTOptionsBuilder', 'DTColumnBuilder', '$compile', '$http', '$rootScope', '$uibModal', '$translate', 'apiService', gradeLevelCtrl])
- function gradeLevelCtrl($scope, $state, $mdDialog, $timeout, $q, $log, $filter, DTOptionsBuilder, DTColumnBuilder, $compile, $http, $rootScope, $uibModal, $translate, apiService) {
- $scope.getDataTable = function () {
- var vm = this;
- vm.dtOptions = DTOptionsBuilder.fromFnPromise(function () {
- var defer = $q.defer();
- var bodyData = {
- schoolId: 1,
- yearId: 1
- };
- $http.post($rootScope.baseUrl + '/grade/list', bodyData)
- .success(function (result) {
- if (result.length < $rootScope.numberOfRecord) {
- $timeout(function () {
- angular.element('.dataTables_paginate').hide();
- }, 200);
- }
- vm.grade = [];
- var index = 1;
- var resultData = result.data;
- angular.forEach(resultData, function (value, key) {}
- , vm.grade);
- defer.resolve(vm.grade);
- }).error(function (error) {});
- vm.dtColumns = [
- DTColumnBuilder.newColumn('index').withTitle($translate.instant('TABLE_LABEL_SR_NO')).withOption('searchable',false),,
- DTColumnBuilder.newColumn('name').withTitle($translate.instant('TABLE_LABEL_NAME')),
- DTColumnBuilder.newColumn('created_at').withTitle('Created at').withOption('searchable',false),,
- DTColumnBuilder.newColumn('status').withTitle('Status').withOption('className', 'tableStatus'),
- DTColumnBuilder.newColumn('operations').withTitle('Actions').withOption('orderable', false).withOption('className', 'tableActions'),
- ];
- }
Add Comment
Please, Sign In to add comment