Can the totals be made to work this way?

Can the totals be made to work this way?

mbornmborn Posts: 44Questions: 17Answers: 0

Have a table like the following example:

https://jsbin.com/tidijiz/2/edit?output

My issue is when I change from running on a monitor to a device like an iPhone. I would like the total lines to work the same way as the detail lines. Instead I get this:

Note: Not sure what I missed to cause the output to look different in the test case as the actual program. Hopefully the picture explains sufficiently. Thanks in advance for any and all assistance.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,770
    edited June 2019

    Your test case has a syntax error. Take a look at the browser's console. Looks like you want the table to be responsive but the footer not responsive. Not sure thats possible but the developers can confirm. Maybe you can place the totals in something other than the footer.

    Kevin

  • mbornmborn Posts: 44Questions: 17Answers: 0

    Thanks for the response, I'll take a look at the test case.

    I did not intend for for the footers to be non-responsive, I want them to work exactly like the table detail. I changed the "responsive:" code to:

                   responsive: {
                        details: {
                            type: 'column',
                            target: -1
                        },
                        footer: {
                            type: 'column',
                            target: -1
                        }
                    },
    

    which didn't change the output.

    When you say "something other than the footer", did you mean a separate table, or did you have something else in mind?

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,770

    I think I see what you are asking now. Looks like the first footer is responsive and the other two aren't. Is that the problem you are asking about?

    did you mean a separate table, or did you have something else in mind?

    I think I misunderstood what you were after. Thought you wanted the column totals to always show.

    Kevin

  • mbornmborn Posts: 44Questions: 17Answers: 0

    The first footer is responsive, except it doesn't have the expand icon that would allow it to display the additional fields. The other footer rows are indeed non-responsive for whatever reason.

  • mbornmborn Posts: 44Questions: 17Answers: 0

    The "Elements" from Chrome showing the last row of the body, and the first and second footer lines:

  • colincolin Posts: 15,146Questions: 1Answers: 2,586

    Hi @mborn ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. 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

  • mbornmborn Posts: 44Questions: 17Answers: 0

    Colin,

    Thanks for the response. I tried to create such a test case and for reasons I don't understand as a beginner, was unable to create one that works as the screen works at my place. The best I could do was to display what the table is displaying and what I want it to do (in short, use footer rows for totals that function in the same manner as the body of the table).

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,770

    I think what @mborn is looking for is in this test case:
    http://live.datatables.net/wajiqoce/1/edit

    1. As probably expected the second tfoot is not responsive.
    2. The first is responsive. Is there a way to get the hidden footer elements and show in child rows?

    Kevin

  • mbornmborn Posts: 44Questions: 17Answers: 0

    Kevin,

    If it turns out that what I am looking to do is not possible, is the solution to create a separate table for the total lines instead of making them a footer?

  • allanallan Posts: 61,726Questions: 1Answers: 10,110 Site admin
    Answer ✓

    Hi,

    I'm afraid that Responsive does not currently support multiple rows in the header or footer of the table. I have started work on the framework I'll need to resolve that in DataTables core, but its not yet finished and will require work in Responsive as well I'm afraid.

    Allan

  • mbornmborn Posts: 44Questions: 17Answers: 0

    Allan,

    Thank you for the response. I'll start working on an alternative way to accomplish this.

This discussion has been closed.