admin 管理员组

文章数量: 1086019

First of all, I have no idea of Javascript's capability on this. But would like to know if it is possible:

  1. To read from a text file and display a very large table (a couple dozens of columns and a few hundred thousands of rows), in sections;
  2. Not all columns will displayed in the same time. columns are in groups. a group of columns needs to toggle between hidden or show;
  3. rows can be filtered based on certain columns.

The reason to do this is to make a report that displays data analysis results and also provides basic filter, sorting functions for the user. They most likely to have some sort of web browser. So HTML would be an ideal format.

Is it possible with Javascript?

Thanks!

First of all, I have no idea of Javascript's capability on this. But would like to know if it is possible:

  1. To read from a text file and display a very large table (a couple dozens of columns and a few hundred thousands of rows), in sections;
  2. Not all columns will displayed in the same time. columns are in groups. a group of columns needs to toggle between hidden or show;
  3. rows can be filtered based on certain columns.

The reason to do this is to make a report that displays data analysis results and also provides basic filter, sorting functions for the user. They most likely to have some sort of web browser. So HTML would be an ideal format.

Is it possible with Javascript?

Thanks!

Share Improve this question edited Sep 22, 2017 at 17:44 CommunityBot 11 silver badge asked Sep 21, 2012 at 14:52 xyliu00xyliu00 7461 gold badge9 silver badges25 bronze badges 2
  • HTML5 provides the File API which can be used to read local files through drag-and-drop. Can't say anything specific about the filter/render performance, but DOM manipulation on that scale is not likely to be very fast. – user1233508 Commented Sep 21, 2012 at 14:57
  • Javascript can do this, yes. It should be mentioned that some browsers cough IE cough are known to get extremely slow with more than a 100 table rows or so. – Jeremy J Starcher Commented Sep 21, 2012 at 15:24
Add a ment  | 

3 Answers 3

Reset to default 4

You might be able to do this by using a grid plugin. For example, have at look at the answers to this question: JavaScript data grid for millions of rows

I would remend a javascript table library such as DataTables. It includes sorting, filtering and pagination options.

Also it has functionality to hand off all the paging, filtering, sorting etc. that DataTables does to a server. The javascript lib DataTables then is just an events and display module. In this case, any number of rows can be handled.

So you would have all the functionality you need, with the ajax-y quick performance of the data loaded in javascript with the scale to handle any number of rows.

Server-side data processing with DataTables

Absolutely yes. Ext.JS shows how to do this very effectively. When done correctly, it is a performance optimization that reduces round trips to server. And improves UX responsiveness.

ExtJS Rich Grid Example. (there are many)

ExtJS Examples. (look at grid section)

Hope that helps.

本文标签: sortingCan javascript sort filter and render a very large tableStack Overflow