2

Controller

  app.controller('myController', ['$scope', 'dashboardService', 'DTOptionsBuilder', function ($scope, dashboardService, DTOptionsBuilder) { 
   $scope.dtMasterOptions =
    DTOptionsBuilder.newOptions()       
    .withDisplayLength(10)
    .withOption('bLengthChange', true)
    .withPaginationType('full_numbers')
    .withBootstrap();       
   $scope.ViewData = function () {       
    var getData = dashboardService.getAllSubmitted();
    getData.then(function (job) {
        $scope.submitedjob = job.data;            
    },
    function (response) { document.write(response.status + "<br/>" + response.data); });
} 
 }]);

html code

       <table style="width:100%;" ng-controller='myController'>
        <tr>
        <td align="center" style="padding:25px;" ng-init=" ViewData();">
            <table datatable="ng" dt-options="dtMasterOptions" class="table table-striped table-bordered" ng-cloak>
                <thead>
                    <tr>
                        <th class="text-danger" style="width:5%;">S. No.</th>
                        <th style="width:10%;">Applicant ID</th>
                        <th style="width:15%;">Email</th>
                        <th style="width:15%;">Full Name</th>
                        <th style="width:10%;">Contact No</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="x in submitedjob" ng-if="x.SubmittedStatus==='Submitted'">
                        <td>{{$index + 1}}</td>
                        <td>{{x.ApplicantID}}</td>
                        <td>{{x.Username}}</td>
                        <td>{{x.Salutation}} {{x.Firstname}} {{x.Middlename}} {{x.Lastname}}</td>
                        <td>{{x.Mobile}}</td>                            
                    </tr>
                </tbody>
            </table>
        </td>
    </tr>
</table>

enter image description here

Here before data loads completely message show 'No data table avaliable' So I want to show Loading message instead of 'No data avaliable' Message before my data load in datatable completely

3
  • see stackoverflow.com/questions/37226074/… and stackoverflow.com/questions/32103524/… Commented Sep 21, 2016 at 5:41
  • Thanks for reply @davidkonrad I tried but not work Commented Sep 21, 2016 at 6:19
  • @Pravinhow can you solve this issue. please help me to solve the same issue in angularjs I am not using ,fromSource function please guide me It's very urgent for me TIA Commented May 18, 2018 at 8:07

1 Answer 1

0

add withOption('processing', true) to your DTOptionsBuilder.newOptions() and it should show Loading message.

Sign up to request clarification or add additional context in comments.

4 Comments

thanks for reply @Deendayal but I already tried its not working
thanks its useful example but when i tried passing like DTOptionsBuilder.fromSource(job.data) and given from proper column name then not showing anything why this?
you were missing the data1.json file. Check this. plnkr.co/edit/sYRSHURwsGsixPkVfhCM?p=preview
No I want to pass like DTOptionsBuilder.fromSource(dataPara) instead of file name Please check in my dataPara variable because my data come in object so i want pass 'dataPara' instead of file name

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.