Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions js/angular-tablesort.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ tableSortModule.directive( 'tsWrapper', ['$parse', '$compile', function( $parse,
$scope.wrappingElementClass = $attrs.tsWrappingElementClass;
}

// If Current Page is passed in
if ( $attrs.tsCurrentPage ) {
$scope.pagination.currentPage = $scope.$eval($attrs.tsCurrentPage)
}

//local attribute usages of the pagination/filtering options will override the global config
if( $attrs.tsPerPageOptions ) {
$scope.pagination.perPageOptions = $scope.$eval($attrs.tsPerPageOptions);
Expand Down
6 changes: 6 additions & 0 deletions typedefs/angular-tablesort.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ declare module 'angular-tablesort' {
declare module 'angular' {
export namespace tablesort {
export interface ITableSortConfigProvider {
/**
* @description Provide a way to jump to a specific page
* @default first page
*/
currentPage: number;

/**
* @description Provide the default function for filtering down items when models change
* @default A lowercase string match for values defined by the ts-criteria attributes with ts-filter also on them
Expand Down