Sorting table by columns
Created 8 years ago by keevitaja

On what it depends, if table can be ordered by a column?

I have fields name and slug, but i can only sort by slug. Name is translatable, slug is not.

    protected $columns = [
        'name', 'slug'
    ];
ryanthompson  —  8 years ago

Ya the table builders don't currently automate sorting by translatable out of the box because joining automatically can be dangerous. You can achieve this manually by defining 'sort_column' parameter for the column and making sure the column is defined in the query using 'onQuerying'.