File tree Expand file tree Collapse file tree 1 file changed +31
-21
lines changed Expand file tree Collapse file tree 1 file changed +31
-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 => $ ( '<strong>' )
27+ . addClass ( 'text-primary' )
28+ . text ( `GROUP: ${ value } ` ) [ 0 ]
29+ . outerHTML ,
30+ columns : [
31+ {
32+ field : 'state' ,
33+ checkbox : true
34+ } ,
35+ {
36+ field : 'shape' ,
37+ title : 'Shape' ,
38+ sortable : true
39+ } ,
40+ {
41+ field : 'color' ,
42+ title : 'Color' ,
43+ sortable : true
44+ } ,
45+ {
46+ field : 'area' ,
47+ title : 'Area' ,
48+ sortable : true
49+ }
50+ ]
51+ } )
4252 }
4353</ script >
You can’t perform that action at this time.
0 commit comments