LoginSignup
1
0

More than 3 years have passed since last update.

DataTableが表に適用されない問題

Posted at

概要

jQueryの処理でHTMLのTableを綺麗に表示したり、ソート、ページングなどの機能を手っ取り早く提供してくれる
DataTableがなぜか適用されない問題を解決

原因

テーブルのデータをPHP(Laravel)からJSONで渡して、Ajaxで動的に生成する流れでテーブルを生成していた。
DataTableの処理部をAjaxメソッドの外側で書いていたのでAjax動作時に同時に処理が行われず
適用されていなかった。

解決法

jsのAjaxメソッドの内側にDataTableを入れる

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0