@@ -167,25 +167,27 @@ export class DataTableController {
167167 this . options . onSort ( sorts ) ;
168168 }
169169
170- var clientSorts = [ ] ;
171- for ( var i = 0 , len = sorts . length ; i < len ; i ++ ) {
172- var c = sorts [ i ] ;
173- if ( c . comparator !== false ) {
174- var dir = c . sort === 'asc' ? '' : '-' ;
175- if ( c . sortBy !== undefined ) {
176- clientSorts . push ( dir + c . sortBy ) ;
177- } else {
178- clientSorts . push ( dir + c . prop ) ;
170+ if ( ! this . options . externalSorting ) {
171+ var clientSorts = [ ] ;
172+ for ( var i = 0 , len = sorts . length ; i < len ; i ++ ) {
173+ var c = sorts [ i ] ;
174+ if ( c . comparator !== false ) {
175+ var dir = c . sort === 'asc' ? '' : '-' ;
176+ if ( c . sortBy !== undefined ) {
177+ clientSorts . push ( dir + c . sortBy ) ;
178+ } else {
179+ clientSorts . push ( dir + c . prop ) ;
180+ }
179181 }
180182 }
181- }
182183
183- if ( clientSorts . length ) {
184- // todo: more ideal to just resort vs splice and repush
185- // but wasn't responding to this change ...
186- var sortedValues = this . $filter ( 'orderBy' ) ( this . rows , clientSorts ) ;
187- this . rows . splice ( 0 , this . rows . length ) ;
188- this . rows . push ( ...sortedValues ) ;
184+ if ( clientSorts . length ) {
185+ // todo: more ideal to just resort vs splice and repush
186+ // but wasn't responding to this change ...
187+ var sortedValues = this . $filter ( 'orderBy' ) ( this . rows , clientSorts ) ;
188+ this . rows . splice ( 0 , this . rows . length ) ;
189+ this . rows . push ( ...sortedValues ) ;
190+ }
189191 }
190192 }
191193
0 commit comments