Get more than 1000 row in the data-table in Angular-JS from MongoDB?
Asked Answered
L

0

0

I am implementing data-table and using MongoDb, Angular-Js. Data-table displaying max to max 1000 row. If API has 999 records then displaying 999 row, If API has 1001 then only displaying 1000 row. If API has 2000 Then also it is displaying 1000.

$scope.standardOptions = DTOptionsBuilder
   .fromFnPromise(R.all('----api call--').getList())
   .withDOM("<'dt-toolbar'<'col-xs-12 col-sm-6'f><'col-sm-6 col-xs-12 hidden-xs'l>r>" +
   "t" +
   "<'dt-toolbar-footer'<'col-sm-6 col-xs-12 hidden-xs'i><'col-xs-12 col-sm-6'p>>")
   .withBootstrap();

$scope.standardColumns = [               
   DTColumnBuilder.newColumn('flightNo').withOption('defaultContent', '-'),
   DTColumnBuilder.newColumn('eta').renderWith(dataRendererETA).withOption('defaultContent', '-'),
   DTColumnBuilder.newColumn('etd').renderWith(dataRendererETA).withOption('defaultContent', '-'),        
];

HTML

      <div class="widget-body no-padding">
              <table datatable dt-options="datatables.standardOptions" dt-columns="datatables.standardColumns" class="table table-striped table-bordered table-hover" width="100%">
                <thead>
                  <tr>
                    <th>Flight no.</th>
                    <th>eta</th>
                    <th> etd</th>                  

                  </tr>
                </thead>
              </table>
         </div>

My some API has more than 1000 records So how can I get all record in data-table.

enter image description here

Loupe answered 30/11, 2017 at 7:27 Comment(5)
Since this is about a nodejs (I believe) script running serverside you should post that code. It has nothing to do with client side nor DataTables, except the possibility of the R service is limiting the number of rows intentionally. Look in your nodejs script, you probably have db.collection.find().limit(1000) or something like that, some where.Nephro
Are you completely sure R.all('----api call--').getList() return more than 1000 records?Nephro
I don't think Angular has something to do with the returned row count.Cephalopod
can we do some callback function. I don't have good knowledge of javacript.Loupe
Have you come any further? Try just make the call some where else in the code and console out the result, or length of the result.Nephro

© 2022 - 2024 — McMap. All rights reserved.