一个聚合物 Web 组件,可从嵌入式或 AJAX JSON、JSON5 和数组中生成可排序的 <table>。
Polymer Web Component that generates a sortable <table> from JSON.
There are many capable Javascript grids, this one aims to have all the same features plus:
template to be fully customizable, andtemplate for customization (Cells, Rows, Column Headers and Footers)Add the library using the Javascript package manager Bower:
bower install --save sortable-table
Import Web Components' polyfill:
Import Custom Element:
Import a theme, like the Bootstrap compatible theme (Optional):
And include class="bootstrap" on any sortable-table to apply.
Start using it!
Start simple and use DOM to configure the grid:
fruit
alice
bill
casey
[
[ "apple", 4, 10, 2 ],
[ "banana", 0, 4, 0 ],
[ "grape", 2, 3, 5 ],
[ "pear", 4, 2, 8 ],
[ "strawberry", 0, 14, 0 ]
]
Or use Javascript attributes:
Or take advanced control with custom templates, 2-way data binding, and a remote datasource:
For detailed changelog, check Releases.
MIT License © Steven Skelton
暂无开放 Issues,或尚未同步最近议题。