简体   繁体   中英

slow performance using datatables jquery plug in and brunch

So i am using Brunch as a framework for the front end of a web application.

And what I am doing is drawing each row of a table as a view and then converting the table to datatables.

I need to have each row as a view for certain ui reasons.

However, performance slows down considerably after 1000 rows.

any ideas of how i can do some kind of clever pagination or defer drawing each row of the table until later or some other idea where i can still have each row of the table as a separate view.

Yes, use bDeferRender - in your options :

bDeferRender: true

From the docs :

Deferred rendering can provide DataTables with a huge speed boost when you are using an Ajax or JS data source for the table. This option, when set to true, will cause DataTables to defer the creation of the table elements for each row until they are needed for a draw - saving a significant amount of time.

For me, it works both when inserting rows by ajax or "native"(the table is static). I have no problem with 10000 rows on a paginated table when using bDeferRender .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM