No "child rows" option

No "child rows" option

ngungongungo Posts: 64Questions: 23Answers: 2

Hi,
In child rows, there is a background of details_open.png or details_close.png. I would like to add an option that 'blank' for selective rows that have no effect when click. In other words, of certain rows I wish no child rows. How do I do that? Any hint appreciated. Thanks.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,269Questions: 26Answers: 4,765
    Answer ✓

    I think all you would need to do is remove the details-control class from the first cell if there is no data to display. This can be done in createdRow if your data doesn't change. Something like this (based on the Row Details example):

              createdRow: function ( row, data, index ) {
                if (data.extn === '') {
                  var td = $(row).find("td:first");
                  td.removeClass( 'details-control' );
                }
    

    If your data can change then use rowCallback instead and add the details-control class back if there is data using else.

    Kevin

  • ngungongungo Posts: 64Questions: 23Answers: 2

    Excellent.
    Thank you. :)

This discussion has been closed.