# AdapterSortableTable | tablefilter v0.5.3 API Document

    import AdapterSortableTable from 'tablefilter/src/extensions/sort/adapterSortabletable.js'

public class | source

# AdapterSortableTable

#### Extends:

Feature → AdapterSortableTable

SortableTable Adapter module

## Constructor Summary

Public Constructor
public | constructor (tf: TableFilter, opts: Object) Creates an instance of AdapterSortableTable |

## Member Summary

Public Members
public | asyncSort : Boolean Enable asynchronous sort, if triggers are external |
public | customKey : String Cell attribute key storing custom value used for sorting |
public | desc : String Module description |
public | imgAscClassName : String Css class for ascending sort indicator image |
public | imgBlank : String Blank image file name |
public | imgClassName : String Css class for sort indicator image |
public | imgDescClassName : String Css class for descending sort indicator image |
public | imgPath : String Path to images |
public | initialized : boolean |
public | name : String Module name |
public | onAfterSort : Function Callback fired after a table column is sorted |
public | onBeforeSort : Function Callback fired before a table column is sorted |
public | onSortLoaded : Function Callback fired when sort extension is instanciated |
public | sortColAtStart : Array Column to be sorted at initialization, ie: sort_col_at_start: [1, true] |
public | sortTypes : Array List of sort type per column basis |
public | triggerIds : Array List of element IDs triggering sort on a per column basis |

## Method Summary

Public Methods
public | addSortType (args: ...*) Adds a sort type |
public | destroy () Remove extension |
public | init () Initializes AdapterSortableTable instance |
public | overrideSortableTable () Set SortableTable overrides for TableFilter integration |
public | sortByColumnIndex (colIdx: Number, desc: Boolean) Sort specified column |

## Inherited Summary

From class Feature
public | config : Object TableFilter configuration |
public | emitter : Emitter TableFilter emitter instance |
public | enabled : Boolean TableFilter feature setting |
public | feature : String Feature name |
public | initialized : Boolean Field indicating whether Feature is initialized |
public | tf : TableFilter TableFilter instance |
public | destroy () Destroy the feature |
public | disable () Disable the feature |
public | enable () Enable the feature |
public | init () Initialize the feature |
public | isEnabled (): Boolean Indicate whether the feature is enabled or not |
public | reset () Reset the feature after being disabled |

## Public Constructors

### public constructor(tf: TableFilter, opts: Object) source

Creates an instance of AdapterSortableTable

#### Override:

Feature#constructor

#### Params:

Name | Type | Attribute | Description
tf | TableFilter |  | TableFilter instance
opts | Object |  | Configuration object

## Public Members

### public asyncSort: Boolean source

Enable asynchronous sort, if triggers are external

### public customKey: String source

Cell attribute key storing custom value used for sorting

### public desc: String source

Module description

### public imgAscClassName: String source

Css class for ascending sort indicator image

### public imgBlank: String source

Blank image file name

### public imgClassName: String source

Css class for sort indicator image

### public imgDescClassName: String source

Css class for descending sort indicator image

### public imgPath: String source

Path to images

### public initialized: boolean source

#### Override:

Feature#initialized

### public name: String source

Module name

### public onAfterSort: Function source

Callback fired after a table column is sorted

### public onBeforeSort: Function source

Callback fired before a table column is sorted

### public onSortLoaded: Function source

Callback fired when sort extension is instanciated

### public sortColAtStart: Array source

Column to be sorted at initialization, ie: sort_col_at_start: [1, true]

### public sortTypes: Array source

List of sort type per column basis

### public triggerIds: Array source

List of element IDs triggering sort on a per column basis

## Public Methods

### public addSortType(args: ...*) source

Adds a sort type

#### Params:

Name | Type | Attribute | Description
args | ...* |  |

### public destroy() source

Remove extension

#### Override:

Feature#destroy

### public init() source

Initializes AdapterSortableTable instance

#### Override:

Feature#init

### public overrideSortableTable() source

Set SortableTable overrides for TableFilter integration

### public sortByColumnIndex(colIdx: Number, desc: Boolean) source

Sort specified column

#### Params:

Name | Type | Attribute | Description
colIdx | Number |  | Column index
desc | Boolean |  | Optional: descending manner