@@ -487,7 +487,6 @@ class BootstrapTable {
487
487
const order = this . options . sortOrder === 'desc' ? - 1 : 1
488
488
const index = this . header . fields . indexOf ( this . options . sortName )
489
489
let timeoutId = 0
490
-
491
490
if ( index !== - 1 ) {
492
491
if ( this . options . sortStable ) {
493
492
this . data . forEach ( ( row , i ) => {
@@ -496,7 +495,6 @@ class BootstrapTable {
496
495
}
497
496
} )
498
497
}
499
-
500
498
if ( this . options . customSort ) {
501
499
Utils . calculateObjectValue ( this . options , this . options . customSort , [
502
500
this . options . sortName ,
@@ -505,22 +503,19 @@ class BootstrapTable {
505
503
] )
506
504
} else if ( this . options . groupBy === true && this . options . groupByField !== '' ) {
507
505
const groupedData = { }
508
-
509
- this . data . forEach ( item => {
510
- const groupKey = Utils . getItemField ( item , this . options . groupByField , this . options . escape ) ;
511
- if ( ! groupedData [ groupKey ] ) {
512
- groupedData [ groupKey ] = [ ]
513
- }
514
- groupedData [ groupKey ] . push ( item )
515
- } ) ;
516
-
517
- const sortedGroups = Object . keys ( groupedData ) . map ( groupKey => {
518
- const group = groupedData [ groupKey ]
519
- Utils . sort ( name , order , index , group , this . header , this . options )
520
- return group
521
- } ) ;
522
-
523
- this . data = [ ] . concat ( ...sortedGroups )
506
+ this . data . forEach ( item => {
507
+ const groupKey = Utils . getItemField ( item , this . options . groupByField , this . options . escape ) ;
508
+ if ( ! groupedData [ groupKey ] ) {
509
+ groupedData [ groupKey ] = [ ]
510
+ }
511
+ groupedData [ groupKey ] . push ( item )
512
+ } ) ;
513
+ const sortedGroups = Object . keys ( groupedData ) . map ( groupKey => {
514
+ const group = groupedData [ groupKey ]
515
+ Utils . sort ( name , order , index , group , this . header , this . options )
516
+ return group
517
+ } ) ;
518
+ this . data = [ ] . concat ( ...sortedGroups )
524
519
} else {
525
520
Utils . sort ( name , order , index , this . data , this . header , this . options )
526
521
}
0 commit comments