File tree Expand file tree Collapse file tree 1 file changed +34
-21
lines changed Expand file tree Collapse file tree 1 file changed +34
-21
lines changed Original file line number Diff line number Diff line change 1414</ script >
1515
1616< template >
17- < table
18- id ="table "
19- data-group-by ="true "
20- data-group-by-field ="shape "
21- data-url ="json/data6.json "
22- >
23- < thead >
24- < tr >
25- < th data-field ="shape ">
26- Shape
27- </ th >
28- < th data-field ="color ">
29- Color
30- </ th >
31- < th data-field ="area ">
32- Area
33- </ th >
34- </ tr >
35- </ thead >
36- </ table >
17+ < table id ="table "> </ table >
3718</ template >
3819
3920< script >
4021 function mounted ( ) {
41- $ ( '#table' ) . bootstrapTable ( )
22+ $ ( '#table' ) . bootstrapTable ( {
23+ url : 'json/data6.json' ,
24+ groupBy : true ,
25+ groupByField : 'shape' ,
26+ groupByFormatter : value => {
27+ const strong = document . createElement ( 'strong' )
28+
29+ strong . className = 'text-primary'
30+ strong . textContent = `GROUP: ${ value } `
31+ return strong . outerHTML
32+ } ,
33+ columns : [
34+ {
35+ field : 'state' ,
36+ checkbox : true
37+ } ,
38+ {
39+ field : 'shape' ,
40+ title : 'Shape' ,
41+ sortable : true
42+ } ,
43+ {
44+ field : 'color' ,
45+ title : 'Color' ,
46+ sortable : true
47+ } ,
48+ {
49+ field : 'area' ,
50+ title : 'Area' ,
51+ sortable : true
52+ }
53+ ]
54+ } )
4255 }
4356</ script >
You can’t perform that action at this time.
0 commit comments