Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82603

Data table doesn't show all results at the first moment

$
0
0

Hi there,

I am very new to DataTables. I'm facing an issue related to the visibility of my results. I'm making an ajax request which returns 5155 items, ordered alphabetically.
But not all of these items are being shown at the first moment. It seems DataTables makes a sumarization of the data, and, for performance issues, "chooses" only some data to show.
For example, I have a lot of words that begin with 'A', but only a few of them are being shown.

Is there anything I need to set on my options to avoid this situation?

That's how my table is being initialized:

$('#myTable').DataTable({
                ajax: {
                    url: "/my_service",
                    dataSrc: function(myList){
                            var data = [];
                            for(var i = 0; myList && i < myList.length; i++){
                               // do some stuff here....
                              data.push({
                                  field1: myList[i].field1,
                                  field2: myList[i].field2,
                                  field3: myList[i].field3,
                                  field4: myList[i].field4
                              })
                            }
                        }
                        return data;
                    }
                },
                columns: [
                    { data: 'field1' },
                    { data: 'field2' },
                    { data: 'field3' },
                    { data: 'field4' }
                ],
                scrollY:        true,
                deferRender: false,
                scroller: true,
                language: {
                    decimal: ',',
                    thousands: '.'
                }
            });

$('#myTable').on( 'init.dt', function (e, settings, results) {
                // do some stuffs here...
            } );

Is there anything I'm missing?

Thanks,

Guilherme


Viewing all articles
Browse latest Browse all 82603

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>