douyanlu7380 2009-06-08 15:04
浏览 28
已采纳

表格分页和使用javascript和php过滤

Let's say that you have to generate and display a table after querying a database using PHP. The table might have a lot of rows. One must be able to filter the resulting table using different criteria (single or multiple selections), much like an Excel table.

example:

+----------------------------------------------------------------+
|         id    |     name      |   type      |    description   |
+----------------------------------------------------------------+
| input search  | input search  | drop down   | drop down        |
| by id field   | by name field | type select | sort asc/desc    |
+---------------+---------------+-------------+------------------+
| 1             | exampe_name   | type 1      | bla bla          |
+---------------+---------------+-------------+------------------+
| 2             | exampe_name 2 | type 2      | tra la la        |
+---------------+---------------+-------------+------------------+
| ...           | ...           | ...         | ...              |
+---------------+---------------+-------------+------------------+

So, I imagined that there should be two pages:

  • one that generates rows and apply selected filters($_GET) on request
  • a second page which displays the table, using some javascript stuff to keep track of the selected criteria, pagination, reload content on filter change and smooth display...

Has anybody encountered such kind of tasks? If yes, please share your solution, thanks in advance.

  • 写回答

1条回答 默认 最新

  • douwei8096 2009-06-09 01:44
    关注

    Take a look at the following: [ORIGINAL URL Removed...] Might that be what you're looking to do?

    Based on @dunc's comment I removed the original URL - looks like we can repalce it with tablefilter.free.fr (the other option the OP found)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?