Ordering Sequence Plugin - Multiple Tables

Ordering Sequence Plugin - Multiple Tables

Huw_PearceHuw_Pearce Posts: 9Questions: 2Answers: 0

https://www.sailwave.com/results/huw/Sailwave-DataTables-ExperimentV07.htm**:
**Debugger code (debug.datatables.net)
: ecepog
Error messages shown: None
Description of problem:
Hi DataTables,

I am a new user of DataTables and I have had some success even though I am a very poor programmer.

The link to the web page I am developing has 3 tables but only the first shows the DataTable 2 Card view (https://codepen.io/RedJokingInn/pen/bGoppqP) and is the only one to allow column ordering using the Ordering Sequence Plugin discussed in the DataTable Blog (https://datatables.net/blog/2024/orderNumbers).

I would very much appreciate help in being shown what I have missed coding wise.

Kind regards,
Huw

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 21,840Questions: 26Answers: 5,049
    edited March 5

    When I go to the page I see this error:

    Failed to load resource: the server responded with a status of 404 (Not Found)

    I maybe missing it but I don't see where you are loading any tables or the datatables library on the page. Please provide steps to see the page with the issues. For example do we need to log in?

    Kevin

  • Huw_PearceHuw_Pearce Posts: 9Questions: 2Answers: 0

    Hi Kevin,

    Thank you for letting me know link is not working.

    I have just noticed in my post that the link has ** at the end, I presume that is because I inadvertently removed the ** before the link address.

    The link is / should have been
    https://www.sailwave.com/results/huw/Sailwave-DataTables-ExperimentV07.htm

    Kind regards,
    Huw

  • kthorngrenkthorngren Posts: 21,840Questions: 26Answers: 5,049
    edited March 5 Answer ✓

    I have just noticed in my post that the link has **

    Sorry I didn't notice that :smile:

    You are only initializing Datatables to the first table with this:

    $("#summarytable").DataTable( ... );
    

    The #summarytable selector is only looking for the table with the id of summarytable. See this example to learn how to target multiple tables with the same configuration. You may want to add the BS classes class="table table-striped table-bordered " to the other two tables and use a selector like this:

    $(".table").DataTable( ... );
    

    Or if you need different configurations for each table you can do that two with multiple initialization statements for each table referencing their id.

    Kevin

  • Huw_PearceHuw_Pearce Posts: 9Questions: 2Answers: 0

    Hi Kevin,

    Thank you for your prompt reply and apologies for not responding sooner.

    Your suggestion of adding class string to other two tables and using alternative selector has worked. Thank you so much.

    FYI - I now have another problem in that for first table the show as Data Card is shown 3 times, for second table twice and third table once. However, I will raise a new topic

    Kind regards,
    Huw

  • allanallan Posts: 64,230Questions: 1Answers: 10,599 Site admin
    Answer ✓

    Just to complete the circle, I've added a reply to your other thread.

    Allan

Sign In or Register to comment.