LoginSignup
1
1

More than 5 years have passed since last update.

jQuery Columns : 要素にリンクを埋め込む

Posted at

概要

jQuery Columns で表を作るとき、要素にリンクを埋め込む。

  • 最初、HTML 文字列で渡したら、タグを消去されたので...
  • 公式ドキュメントには書いてあったが日本語で引っかからなかったのでメモ

方法

schema にて、template を指定する。(公式の Example 3)

data = [{"id": 1, "url": 'test/01/index.html'},
        {"id": 2, "url": 'test/02/index.html'},]

$("#columns").columns({
    data: data,
    schema: [
        {"header": "id", "key": "id"},
        {"header": "url", "key": "url", "template": '<a href="{{url}}">{{url}}</a>'},
    ],
})

参考

1
1
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
1