We're Moving to a New Support Platform – Starting June 1st!

We’re excited to let you know that starting June 1st, we’ll be transitioning to a new support system that will be available directly on our product websites – Amelia, wpDataTables, and Report Builder. In fact, the new support platform is already live for Amelia and wpDataTables, and we encourage you to reach out to us there.

You'll always be able to reach us through a widget in the bottom right corner of each website, where you can ask questions, report issues, or simply get assistance.

While we still do not offer live support, a new advanced, AI-powered assistant, trained on our documentation, use cases, and real conversations with our team, is there to help with basic to intermediate questions in no time.

We're doing our best to make this transition smooth and hassle-free. After June 1st, this current support website will redirect you to the new "Contact Us" pages on our product sites.

Thanks for your continued support and trust – we’re excited to bring you an even better support experience!

Okay
  Public Ticket #935130
Make select columns unsortable
Closed

Comments

  •  2
    sllow88 started the conversation

    Hello!

    I have just acquired Wpdatatables, but I'm having some issues:

    1. Is there a way to make only some columns unsortable on a table? Specifically I need to make columns 0 and 3 unsortable.

    2. Is there a way to have  no displayed header on a column? I tried erasing it on "Optional column setup" but when saving the header "title" comes back.

    3. Is there a way to get rid of the vertical innner borders of all tables? I tried using some custom CSS, but had no luck.


    Thanks!

  • [deleted] replied

    Hi sllow88,
    Thank you for your purchase.

    1. You can add this code on page where your table is located:

    <script>
    jQuery(function(){
        jQuery(document).ready(function(){
            wpDataTables.table_1.fnSettings().aoColumns[0].bSortable = false;
            wpDataTables.table_1.fnSettings().aoColumns[2].bSortable = false;
        });
    });
    </script>
    

    2. It is not possible if you remove column header, but it can be done with CSS or little jQuery snippet.

    3. Please send me a link of your table so I can take a look. And please specify me what borders you want to remove.

  •   sllow88 replied privately
  • [deleted] replied

    Hi sllow88,

    I have sorting enabled on my table but would like to have a "Show featured items first" on my table like the one on http://www.money.co.uk/loans.htm
    -Unfortunately this feature is not available out of the box, and it can be done just with some custom coding.

  •   sllow88 replied privately
  •  2
    sllow88 replied

    I have found the following code on datatables forum https://datatables.net/forums/discussion/4866/sorting-on-multiple-columns

    $(document).ready(function() {
    var oTable = $('#tablehtml').dataTable();
    $('#tablehtml thead th:eq(2)').unbind('click').click(function(){
    var aaSorting = oTable.fnSettings().aaSorting;
    if( aaSorting[0][0] !=2 || aaSorting[0][1] == 'desc'){
    oTable.fnSort( [[2,'asc'], [3,'asc']]);
    }else{
    oTable.fnSort( [[2,'desc'], [3,'asc']]);
    }
    });
    } );

    However it seems there needs to be done some modifcations for WpDtatables.

    Would that code work?

    Thanks for the attention!

  • [deleted] replied

    Hi sllow88,

    Yes with little modifications of what you need. You will also have to change table selector #tablehtml to #table_1, #table_2... You can see what is the selector of the table when you inspect elements. And this code with little modifications would work on non-editable tables. For MySQL and Manual tables you can use MySQL query to sort table.