Skip to content

Commit 51b44d5

Browse files
committed
Enhance group-by-v2 example with full configuration
* Implement groupBy functionality with custom formatter * Add sortable columns for shape, color, and area * Include checkbox selection for state field
1 parent 5958310 commit 51b44d5

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

extensions/group-by-v2.html

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,35 @@
3838

3939
<script>
4040
function mounted () {
41-
$('#table').bootstrapTable()
41+
$('#table').bootstrapTable({
42+
url: 'json/data6.json',
43+
groupBy: true,
44+
groupByField: 'shape',
45+
groupByFormatter: value => $('<strong>')
46+
.addClass('text-primary')
47+
.text(`GROUP: ${value}`)[0]
48+
.outerHTML,
49+
columns: [
50+
{
51+
field: 'state',
52+
checkbox: true
53+
},
54+
{
55+
field: 'shape',
56+
title: 'Shape',
57+
sortable: true
58+
},
59+
{
60+
field: 'color',
61+
title: 'Color',
62+
sortable: true
63+
},
64+
{
65+
field: 'area',
66+
title: 'Area',
67+
sortable: true
68+
}
69+
]
70+
})
4271
}
4372
</script>

0 commit comments

Comments
 (0)