> For the complete documentation index, see [llms.txt](https://matanya.gitbook.io/vue-tables-2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://matanya.gitbook.io/vue-tables-2/custom-sorting.md).

# Custom Sorting

### Client Side Sorting&#xD;

Sometimes you may wish to override the default sorting logic which is applied uniformly to all columns.

To do so use the `customSorting` option. This is an object that recieves custom logic for specific columns.

E.g, to sort the `name` column by the last character:

```javascript
customSorting: {
    name: function (ascending) {
        return function (a, b) {
            var lastA = a.name[a.name.length - 1].toLowerCase();
            var lastB = b.name[b.name.length - 1].toLowerCase();

            if (ascending)
                return lastA >= lastB ? 1 : -1;

            return lastA <= lastB ? 1 : -1;
        }
    }
}
```

### &#x20;Server Side Sorting&#xD;

This depends entirely on your backend implemetation as the library sends the sorting directions through the request.
