Speed up drawing time
Speed up drawing time
biro
Posts: 12Questions: 7Answers: 0
Hi! I'm working with datatables, and a huge amout of data.
I was wondering how to speed up the drawing time.
i got paging set to true (25 rows per page), but if i resize the window, it takes up to 5-6 seconds to fit the width.
is the something that i miss?!
thank you
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi
Not clear what you do exactly. Do you resize your browser window with 25 rows data DataTable? How many columns you have.
In my table with 25-50 rows 10 columns, browser window resize takes less than second.
sorry, maybe i'm not clear
my table has 15k row and 20 columns.
the datatable is rendered in my browser window (actually an electron/nodejs project)
so it very common to resize the window.
i think that the amoun of data, slows down the draw() function...it takes 5-6 seconds to redraw the table correctly
here's the code that i use to manage the resize:
You should be able to remove that code and just have
width="100%"
on thetable
element. DataTables will automatically do the resize for you and it will also throttle it so it doesn't kill your browser.Allan
it works! thanks allan!
i feel so dumb right now
Its not that obvious really! Reading a precentage value from CSS is a massive PITA which is why that is required. It lets DataTables know that you want it to be 100% width and it can run some code to keep it that way.
Allan