GitHubで確認

カスタムビュー

Bootstrap Tableのカスタムビュー拡張機能。

説明

この拡張機能は、データを表示するためのカスタムビューを作成する機能を追加します。

使用方法

<script src="extensions/custom-view/bootstrap-table-custom-view.js"></script>

カスタムビュー

オプション

customView

  • 属性: data-custom-view

  • 型: 関数|論理値

  • 詳細

    この拡張機能を無効にするにはfalseに設定します。関数に設定してカスタムビューをフォーマットします。

  • デフォルト: false

customViewDefaultView

  • 属性: data-custom-view-default-view

  • 型: 論理値

  • 詳細

    カスタムビューをデフォルトビューとして表示するにはtrueに設定します。

  • デフォルト: false

showCustomView

  • 属性: data-show-custom-view

  • 型: 論理値

  • 詳細

    カスタムビューの切り替えボタンを表示するにはtrueに設定します。

  • デフォルト: false

アイコン

  • customViewOn
    • Bootstrap3: glyphicon glyphicon-list
    • Bootstrap4: fa fa-eye
    • bootstrap5: ‘bi-eye’,
    • Semantic: fa fa-eye
    • Foundation: fa fa-eye
    • Bulma: fa fa-eye
    • Materialize: remove_red_eye
  • customViewOff
    • Bootstrap3: glyphicon glyphicon-thumbnails
    • Bootstrap4: fa fa-th
    • bootstrap5: ‘bi-grid’,
    • Semantic: fa fa-th
    • Foundation: fa fa-th
    • Bulma: fa fa-th
    • Materialize: grid_on

メソッド

toggleCustomView

  • テーブルとカスタムビュー間のビューを切り替えます。

イベント

onCustomViewPreBody

  • jQueryイベント: custom-view-pre-body.bs.table

  • パラメータ: undefined

  • 詳細

    カスタムビューがレンダリングされる前に発生します。

onCustomViewPostBody

  • jQueryイベント: custom-view-post-body.bs.table

  • パラメータ: undefined

  • 詳細

    カスタムビューがレンダリングされた後に発生します。

onToggleCustomView

  • カスタムビューが切り替えられたときに発生します。

  • jQueryイベント: toggle-custom-view.bs.table

  • パラメータ: state

  • 詳細

    カスタムビューが切り替えられたときに発生します。

    • state: 新しいカスタムビューの状態 (true-> カスタムビューが有効、false -> カスタムビューが無効)

ローカライゼーション

formatToggleCustomViewOn

  • 型: 関数

  • デフォルト: function () { return "カスタムビューを表示" }

formatToggleCustomViewOff

  • 型: 関数

  • デフォルト: function () { return "カスタムビューを隠す" }