1

1000行のhtmlテーブルがあります。クライアントでそれらの行をソート/検索したい。データは Web サービスから取得されます。
今、1ページあたり100行のページングを追加しようと考えていましたが、クライアント側のパフォーマンスが悪いです. (私は次のようなことを考えていました:display:none;非表示の行の場合。

今、私はこのアプローチのいくつかの実装を探し始めました.datatablesを使用すると、最初にそれらの行をdomに追加せずにクライアント側でソート/検索を実行できることがわかりました。 http://datatables.net/ 開発者コンソールで生成された DOM を調べましたが、行を非表示にする方法がわかりません。何か案は?

4

2 に答える 2

0

I looked at the generated dom in developers console and still cannot figure out how they hide rows. Any ideas?

The JS code reads the table into javascript variables, specifically into a variable oSettings.aoData.

From there, they only actually load the table elements that need to be seen, so they are not actually hiding and unhiding rows (i.e. with dispaly:none) - the table rows actually get removed from the DOM, stored as javascript objects, and loaded into or removed from the DOM as needed.

于 2013-05-18T21:15:46.380 に答える