json or DOM?

json or DOM?

KingWilliamKingWilliam Posts: 3Questions: 0Answers: 0
edited July 2012 in DataTables 1.9
I am currently populating a DOM table and let DataTables turn it into a nice table.

Now I am facing the fact that I have a table with over 400 rows and about 6 columns. The rendering of this table is really becoming slow. I do not have the time now to introduce server-side processing. What I can do, is turn the data into json instead of DOM. But before I start this, I would like to know what kind of benifit this will give me.

I must also say that this table does not contain data only, but also some columns with buttons.

Thanks

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Using JSON data can have a huge benefit because then you can enable deferred rendering - see http://datatables.net/faq#speed . Worth noting that all browsers should really be able to cope no problem with just 400 rows in a table though (perhaps IE6 might struggle a little...?).

    Allan
  • KingWilliamKingWilliam Posts: 3Questions: 0Answers: 0
    Thank you for the info Allan. Probably something else is going wrong. Since I am testing in Chrome it should not be due to "a slow browser".

    Could it maybe related to the fact that one of my columns consists of a bunch of html (form + button)? I am already planning to remove that anyway and replace it with a , having some javascript. But if you say it will make a big difference in this speed issue, I might do that earlier.

    Wim
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited July 2012
    I doubt it would, but if you can give us a link it would be interesting to run a profiler on it.

    Allan
  • KingWilliamKingWilliam Posts: 3Questions: 0Answers: 0
    I removed that form, and things seem to go a lot faster now. I do not think I changed anything additional.

    Anyhow, thanks for the help. I will probably convert to json anytime soon anyway, so things will probably fly then.

    Thanks!
This discussion has been closed.