How do I get the Row Group to be at the bottom of the group?

How do I get the Row Group to be at the bottom of the group?

solfshrsolfshr Posts: 5Questions: 0Answers: 0
edited June 2012 in General
Hello Allan,

Thanks for creating this wonderful plug-in. I have been using it for over two years on several web applications that I am the UI designer for. I am currently using DataTables 1.9.

I have a requirement for a web page that I am designing to have a row at the bottom of each category that shows a total amount. I've tried both your example for row grouping and Jovan's row grouping plug-in, but I have not figured out a way position the group row after the group. Can you please help me with this?

I have also tried using fnAddRow without success. Please let me know if you need any more information.

Thank you for your time,

Cassandra

P.S. - I have also purchased support.

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Hi Cassandra,

    Thanks for picking up the DataTables support. I've modified my example for doing row grouping using fnDrawCallback to append the rows at the end of the group, as you requested, which you can see here: http://live.datatables.net/erevun/edit#javascript,html .

    I'm not entirely sure how this would be done with Jovan's plug-in, which is third party and therefore unsupported as part of the DataTables project, but I suspect a similar modification would be all that is needed.

    The way this method of row grouping rows is to insert "uncontrolled" TR elements into the table, based on the information that is drawn in the table, which will then be destroyed at the next draw. fnAddData would insert "controlled" elements, which individually obey the filtering, sorting etc that is applied to the table - hence why my example shows this way of doing it.

    Regards,
    Allan
  • solfshrsolfshr Posts: 5Questions: 0Answers: 0
    Hello Allan,

    Thank you so much for your help. It works well, however, it doesn't seem to get the first group name correct. I changed the HTML of the first two rows of the rendering engine from 'Trident' to 'Custom' to make sure it wasn't a mistake with my HTML and it appears to skip 'Custom' as a group name and inserts 'Gecko' instead of 'Custom'. Here are a couple of screen-shots:

    Screen-shot 1: https://dl.dropbox.com/u/35003486/Screen%20Shot%201.png
    Screen-shot 2: https://dl.dropbox.com/u/35003486/Screen%20Shot%202.png

    Cassandra
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Hi Cassandra,

    Sorry about that - a slight flaw in my logic when assigning sLastGroup. Here is the correction: http://live.datatables.net/erevun/2/edit

    Regards,
    Allan
This discussion has been closed.