This repository was archived by the owner on Jan 7, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ The data table can be created with the following `options`:
148148- ` rowHeight ` : Row height in pixels, necessary if using lazy rendering (default: ` 30 ` )
149149- ` scrollbarV ` : Enable vertical scrollbars (default: ` true ` )
150150- ` selectable ` : Whether users can select items (default: ` false ` )
151+ - ` sortType ` : Whether to allow sorting by multiple columns or only 1 (` multiple ` or ` single ` ) (default: ` multiple ` )
151152
152153## Contributing
153154
Original file line number Diff line number Diff line change 4242 </ head >
4343 < body ng-app ="app " ng-controller ="HomeController ">
4444
45+ < label > < input type ="checkbox " ng-model ="multiple " ng-change ="updateSortType() " /> Multi column sorting</ label >
4546
4647 < dtable options ="options " rows ="data " class ="material " on-sort ="onColumnSort(sorts) "> </ dtable >
4748
6263 } )
6364 }
6465
66+ $scope . updateSortType = ( ) => {
67+ $scope . options . sortType = $scope . multiple === true ? 'multiple' : 'single' ;
68+ }
69+
70+ $scope . multiple = true ;
71+
6572 $scope . options = {
6673 rowHeight : 50 ,
6774 headerHeight : 50 ,
6875 footerHeight : false ,
6976 scrollbarV : false ,
70- sortType : 'multiple' , // available options: ['single', 'multiple']
77+ sortType : 'multiple' ,
7178 // onSort: $scope.onColumnSort,
7279 columns : [ {
7380 name : "Name" ,
Original file line number Diff line number Diff line change @@ -63,6 +63,9 @@ export const TableDefaults = {
6363 // if you can reorder columns
6464 reorderable : true ,
6565
66+ // sorting by single or multiple columns
67+ sortType : 'multiple' ,
68+
6669 internal : {
6770 offsetX : 0 ,
6871 offsetY : 0 ,
You can’t perform that action at this time.
0 commit comments