Two DataTable instances do not sort corresponding data according to "order" parameter

Two DataTable instances do not sort corresponding data according to "order" parameter

AmitBgtAmitBgt Posts: 3Questions: 1Answers: 0

Hi,
<<PLEASE... NEED URGENT ASSISTANCE >>
I am using Thymeleaf template to load Lists on two different pages (Page XList and Page RList) with Spring Framework.
These two pages were selected via application menu bar.

There are two different test scenarios..

Case I::
Step - 1: Click on XList menu option, Datatable instance on XList page draws table with expected sortng order.
Step - 2: Click on RList menu option, Datatable instance on RList page does not draw table with expected sortng order.
Step - 3: Click on XList menu option, Datatable instance on XList page does not draw table with expected sortng order.

Sorting order is random in Step-2 & 3 when you perform this scenario every time.

Case II::
Step - 1: Click on RList menu option, Datatable instance on RList page draws table with expected sortng order.
Step - 2: Click on XList menu option, Datatable instance on XList page does not draw table with expected sortng order.

Sorting order is random in Step-2 & 3 when you perform this scenario every time.

Case III::
Step - 1: Click on XList menu option, Datatable instance on XList page draws table with expected sortng order.
Step - 2: Click on any other menu option or perform any other page action (other than Datatable) and then click XList page. Datatable instance on XList page draw table with expected sortng order.
Step - 3: Click on RList menu option, Datatable instance on RList page does not draw table with expected sortng order.
Step - 4: Click on XList menu option, Datatable instance on XList page does not draw table with expected sortng order.

Sorting order is random in Step-2 & 3 when you perform this scenario every time.

Case IV::
Repeat Case III with for RList.

Please note that XList and RList are Thymeleaf Fragments. and jQuery load method is responsible for loading these fragment in parent page.

Below is the datatable code

For RList
$('.lstrprttbd-comma-decimal-place').DataTable({ "language": { "decimal": ",", "thousands": "." }, "order": [[ 8, "desc" ]], "columnDefs": [{ "targets": [ 7 ], "visible": false, "searchable": true },{ "targets": [ 8 ], "visible": false, "searchable": true }] });
For Xlist
$('.lstxpnstbld-comma-decimal-place').DataTable({ "language": { "decimal": ",", "thousands": "." }, "order": [[ 8, "desc" ]], "columnDefs": [{ "targets": [ 8 ], "visible": false, "searchable": true }] });

Thanks!
Amit B

This question has accepted answers - jump to:

Answers

  • AmitBgtAmitBgt Posts: 3Questions: 1Answers: 0

    Please note that Column 8 is java sql Timestamp ...

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945
    Answer ✓

    There is not much to go on to help. The best option is to provide a link to your page for help in debugging. If that doesn't help maybe you can provide an example using your data and timestamp.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Without seeing the non-working scenarios in a running example its hard to say. I would start by making a simple environment with just your data and Datatables to determine if its something related to the data within Datatables.

    Kevin

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Hi @AmitBgt ,

    I'm not clear what the problem is that you're asking for help with. We're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • AmitBgtAmitBgt Posts: 3Questions: 1Answers: 0

    Cool.. will surely do what is required by rules of this forum.. Give me some time please.. as this is not a stopper currently and I need to complete rest of the modules ASAP..

    Thanks a lot... Will seek your assistance soon.. Cheers!

This discussion has been closed.