How to render DataTables when every ODD row is an accordion row that's hidden... and...

How to render DataTables when every ODD row is an accordion row that's hidden... and...

pborreggpborregg Posts: 59Questions: 2Answers: 0
edited December 2013 in DataTables 1.9
I have a datatable that's rendered with accordion rows to show DETAILS for the current row selected.

Problem: The UNKNOWN parameter error occurs on ROW [1] the first DETAIL row for ROW[0]. The same thing occurs for ROW[3,5,7,9,11, and so on.... to row n]

Also, to complicate things even more, we have three conditions: CRITICAL, WARNING and OKAY. Only Critical and Warning show initially and OKAY is toggled by the user.

Hence, when the table is initially rendered, there are NO green or OKAY rows. Only RED (Critical) and YELLOW (Warning) rows which can be toggled on and off and deleted (removed) from the database there by a return trip to the server would be required to repaint the table.

It's really funky.

Any suggestions?

Thanks,

Peter

Replies

  • allanallan Posts: 63,493Questions: 1Answers: 10,470 Site admin
    This isn't possible in the way you describe - there is no link between rows in DataTables. You would need to use the row details like in the example here if you want to use a child row attached to a parent: http://datatables.net/release-datatables/examples/api/row_details.html

    DataTables requires that this equation be satisfied: `rows * columns = cells` . If that is not true, then you will get errors.

    Allan
  • pborreggpborregg Posts: 59Questions: 2Answers: 0
    edited December 2013
    OK, I get it... but we have the following for our Row Details to format the table correctly with a colspan...







    .... more divs and code....







    According to your above reference and discussion.... my code above, won't work...correct?
  • pborreggpborregg Posts: 59Questions: 2Answers: 0
    OK apparently my code didn't display... here it is again:

    [code]







    ...more code...







    [/code]
  • pborreggpborregg Posts: 59Questions: 2Answers: 0
    Allan, sorry but my code isn't posting even with the [code}... [/code] (CODE) tags
  • allanallan Posts: 63,493Questions: 1Answers: 10,470 Site admin
    I know - there is something wrong with the forum and HTML. I'm just about to look into it once I've finish my daily 2-3 hours of forum questions.

    Allan
  • pborreggpborregg Posts: 59Questions: 2Answers: 0
    [code]














    [/code]
  • pborreggpborregg Posts: 59Questions: 2Answers: 0
    Anyway, that being said... thanks because I thought it was me being 53, yrs old, my mind is going... LOL.

    Seriously, if I have to format this using NO COLSPANS, I can... if that'll work, my employer will just have to understand.
  • allanallan Posts: 63,493Questions: 1Answers: 10,470 Site admin
    > Seriously, if I have to format this using NO COLSPANS, I can... if that'll work, my employer will just have to understand.

    There are two ways to attach one row to another in DataTables at the moment - neither of which will work automatically:

    1. Row details using fnOpen / fnClose . You could just have them "open" all of the time.
    2. Manually using fnDrawCallback - attach them as needed.

    Allan
This discussion has been closed.