2018-11-01から1ヶ月間の記事一覧
適当なフォーマットのテキストデータを読み込んでjson形式で出力します。 ログに出力したデータをDatatablesで表示できるような形にするイメージです。data.txt [Player] X[1] Y[2] Type[0] [Enemy] Level[1] Name[xxx] Color[Red] ------------------------…
セレクトボックスで選んだ値をdatatableのsearchに使用します。 jsonは1つ前の記事と同じものを使用。test.html <html lang="ja"> <head> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/s/dt/dt-1.10.10/datatables.min.css"/> <script src="http://code.jquery.com/jquery-2.2.0.min.js"></script> </link></head></html>
datatableのデータとしてオブジェクト形式のjsonデータを使うやり方。 ローカルで表示する場合はchromeだとセキュリティポリシーがうんたらでファイルが読み込めないので、firefoxを使うかオプション付きでchromeを起動しておく必要がある。test.html <html lang="ja"> <head> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/s/dt/dt-1.10.10/datatables.min.css"/> </link></head></html>