Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How I can specify the sort direction for the particular column? #226

Closed
adw0rd opened this issue Feb 18, 2015 · 2 comments
Closed

How I can specify the sort direction for the particular column? #226

adw0rd opened this issue Feb 18, 2015 · 2 comments
Labels

Comments

@adw0rd
Copy link

adw0rd commented Feb 18, 2015

function MainStatisticCtrl(DTOptionsBuilder, DTColumnDefBuilder) {
    var vm = this;
    vm.dtOptions = DTOptionsBuilder.newOptions()
        .withPaginationType('full_numbers')
        .withDOM('rt<"row"<"col-sm-6"l><"col-sm-6"p>>');
    vm.dtColumnDefs = [
        DTColumnDefBuilder.newColumnDef(0), // <<< HERE
    ];
@l-lin
Copy link
Owner

l-lin commented Feb 18, 2015

You need to use the order attribute.

@adw0rd
Copy link
Author

adw0rd commented Feb 19, 2015

Thank you, so is working:

function MainStatisticCtrl(DTOptionsBuilder) {
    var vm = this;
    vm.dtOptions = DTOptionsBuilder.newOptions()
        .withPaginationType('full_numbers')
        .withOption('order', [[0, 'desc']])
        .withDOM('rt<"row"<"col-sm-3"l><"col-sm-3"i><"col-sm-6"p>>');

@adw0rd adw0rd closed this as completed Feb 19, 2015
@l-lin l-lin added the question label Feb 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants