• Resolved iresearchex

    (@iresearchex)


    hi, please help me, i have a table which has 4 columns, the last one is number, i want it show when first load is from higher to lower number. I have research lot the code are like :
    <script type=”text/javascript”>

    $(document).ready(function() {
    $(‘#table_1’).DataTable( {
    order: [[ 3, ‘desc’ ]]
    } );
    } );

    </script>

    Pls help me asap, thanks in advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter iresearchex

    (@iresearchex)

    add-on

    i put the code inside wp datatable-> setting -> custom js and css -> Custom wpDataTables JS

    Thread Starter iresearchex

    (@iresearchex)

    pls help me? anyone?

    Plugin Author wpDataTables

    (@wpdatatables)

    Hi iresearchex,

    Thank you for your interest in wpDataTables.

    You don’t need to use custom JS. In column settings for all columns, you have the Sorting tab if the Sorting option in table settings is turn on. Each column has a “Default sorting column” switch. If you enable this switch for one of the columns, a selectbox will appear with options – “Ascending” and “Descending”, where you can choose the sorting direction
    More about sorting you can read in our docs about Creating a sortable table in WordPress

    For Simple tables, we do not have such functionality at the moment.

    Best regards.

    • This reply was modified 3 years, 8 months ago by wpDataTables.
    Thread Starter iresearchex

    (@iresearchex)

    @wpdatatables omg, thanks alot! it helps!

    Plugin Author wpDataTables

    (@wpdatatables)

    Hi iresearchex,

    You are welcome.

    Best regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Default sorting of specific column’ is closed to new replies.