Partial display of large table in jQuery

I have a table with about 5000 rows which I am dynamically building with jQyuery. I was wondering if there is a way to display rows in chunks as the table is created until finally all rows are shown?

I tried this but no luck. So far I have tried the following:

a) Making stubs b) Getting common rows and dividing them into smaller pieces. c) Entering the first fragment into the table and including a function call in the last line to call the next batch of data to load).

Unfortunately, even this way he wants to wait until everything is displayed. Is there a way to get around this?

0


a source to share


3 answers


Use setTimeout to create the next slice of the table, ditching the UI thread a bit, it will render the parts of the table as it is created.



By calling the generate code at the bottom of the generated code, you never give up the stream.

+1


a source


Why do you need 5K lines in a webapp? I highly recommend using paging.



Otherwise solution c) seems to be the best and should work. Perhaps you just need a little tweak. Are you calling the next batch of data with an ajax call? What do you see when loading the next batch of data? Does the browser launch?

0


a source


paging would be the best solution. there are already some good jquery datagrid plugins in the scene like flexigrid and jqgrid . check them out.

0


a source







All Articles