Data

Data

caspiancaspian Posts: 1Questions: 0Answers: 0
edited March 2009 in General
Hello,

This looks really good...

Just a quick question...if you have a table with images and text, about 150 records, does it load all 150 at once? Or if you have it display 20 at a time, loads the 2nd, 3rd, etc sets only when you go to the next set?

We are trying to find a solution to display our portfolio online, and this seems promising.

Thanks.

Replies

  • sihing_stevesihing_steve Posts: 6Questions: 0Answers: 0
    edited March 2009
    I'm working on a DBMS project right now, which uses DataTables to display 21 different values for 100 devices at a time. (2100 total form elements/values)

    Even though I have decided to change from the above method (preloading the 2100 values then paginating them) to a call/request method using XMLHttpRequest or sAjaxSource, I am rather impressed at the speed of DataTables. Even with all those values, there is only a small delay in displaying the page. :-)

    So I guess to try and answer your question, it would appear you could use either way. There is a HUGE amount of flexibility here, hats off to the author. I'll have to "donate" a pint when I get a chance.
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Hi caspian,

    With DataTables it expects to find all of the required data on the page, so it can do things such as filtering, sorting etc. If all of the data wasn't available you would be filtering or sorting only a sub-set of that data - or you would need to reload the data from the server (telling it what to sort on etc) on every action (at which point DataTables would become an empty shell).

    One option, if you are concerned about loading 150 images at a time, is to load the data via Ajax (or just a plain Javascript array) - doing this, the browser will only load each image when it is rendered on the page. However you need to remember those who don't have Javascript!

    As sihing_steve notes, DataTables should be perfectly capable of dealing with 150 rows of data.

    @sihing_steve: Good to hear that the speed of DataTables is decent even with a reasonable number of rows (I did hear from a few people who were using it for 50'000 odd rows of data and it was still performing okay...). Also, beer is always welcome ;-)

    Regards,
    Allan
  • allealle Posts: 1Questions: 0Answers: 0
    Hi all,
    first of all thanks to Allan for his efforts into developing this plugin, documentation and for setting up this forum.
    I would like to see DataTables in action with Ajax request in pagination and search, in order to limit the response time on the first load and the traffic load.
    For example, it would be great if shining_steve could report his experience, or if Allan would set up an example on that. I guess, total rows and page number, page limit, etc. would be in the JSON response, beneath the rows data.
    Even the search function would be implemented in Ajax.
  • sihing_stevesihing_steve Posts: 6Questions: 0Answers: 0
    Allan,

    Thanks again for some great code. I'll get that pint to you later today.
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Hi alle,

    Fully Ajax based is certainly an interesting direction to take DataTables, however, I think that nearly everything that I have implemented on the client-side would have to be re-done to be implemented on the server-side. For example if I had a global filter of 'Allan', a second column filter of '1', and multi-column sorting in use, that owuld require a very specific Ajax call to be dealt with on the server side. The server-side implementation would also completely depend on your backend system and how it is structures.

    And this point, as I noted before, DataTables would become an empty shell - simply an event manager sending out Ajax requests to the server. This would be trivial to do on the client-side, but server dependent. As such, this isn't a direction I plan to take DataTables at the moment.

    Having said that, please let there not be any misunderstanding about DataTables not supporting Ajax - it most certainly does. It is simply a client-side tool, rather than a server-side one.

    Regards,
    Allan
  • petterpetter Posts: 8Questions: 0Answers: 0
    I agree with Allen here.
    Loading a bunch of lines isn't a big problem. I hide the table trough css and show it when datatable has done it's job. Then you avoid flickering the large table as well. I belive 'drawing' then table clientside is what takes time. Not sending the data to the client..
  • JamesJohnsonJamesJohnson Posts: 4Questions: 0Answers: 0
    edited March 2009
    Ditto. There are other table plug ins designed to pass filter and sort parameters back to server if you want your database engine to do the filter/sort. This would be the natural choice if you have a very large number of records to filter/sort. On the other hand, if you want interactive filter/sort, and you don't have so many records, Data Tables will do the job without any callbacks to the server. Cutting down on the "chit chat" is nice if you want to reduce the load on your web server and/or database server. Even if you're lucky enough to have under-utilized fast servers, it might still offer better interactive performance over slower connections like the Internet.
  • nathacofnathacof Posts: 2Questions: 0Answers: 0
    edited October 2009
    nothing to see here.
This discussion has been closed.