datatable.js DESC List

datatable.js DESC List

muammermuammer Posts: 8Questions: 1Answers: 0

Hello there.
The template I used was also added as a datatables plugin.
I want to sort my data by 0 index.
template datatables works without yielding ID.
How do I set it in datatables.js?

Replies

  • kthorngrenkthorngren Posts: 20,269Questions: 26Answers: 4,765
    edited August 2019

    Not sure I understand the question but if you want to se the initial table order you can use the order option. If this doesn't help please provide more details of what you want to do.

    Kevin

  • muammermuammer Posts: 8Questions: 1Answers: 0

    Tarihine göresıralama istiyorum.
    enson eklenen üstte olmasını istiyorum.
    $ ('# example'). veri tablosu ({
    "sipariş": []
    });
    Denedim ama olumsuz oldu.
    Datatables.js ile bunu nasıl yapabilirim.
    'ORDERBY DESC' veri tablolarıyla nasıl yapabilirim?

  • muammermuammer Posts: 8Questions: 1Answers: 0

    I want to sort by date.
    enson would like to have added on top.
    $ ('# example'). data table ({
    "order": []
    });
    I tried but that was the downside.
    How can I do this with datatables.js.
    How do I make 'ORDERBY DESC' with data tables?

  • muammermuammer Posts: 8Questions: 1Answers: 0

    datatables template içinde plugin olarak var.
    id vermeden datatables etkin kullanılıyor.
    datatables.js içinde nasıl düzenlerim ?

  • muammermuammer Posts: 8Questions: 1Answers: 0

    Javascript ile nasıl datatable sıralayabilirim? datatables.js

  • kthorngrenkthorngren Posts: 20,269Questions: 26Answers: 4,765

    You would use order to change from the default order. The docs have examples. Something like this:

    $('#example').dataTable( {
        "order": [[ 0, 'desc' ]]
    } );
    

    Then you would use the solution described in this blog about date time sorting:
    https://datatables.net/blog/2014-12-18

    Doing both should get your date column sorting correctly. If this doesn't help then please post a link to your page or a test case replicating the issue. This will allow us to see what you have and offer suggestions to fix.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

This discussion has been closed.