RowGroup: Adding a button

RowGroup: Adding a button

jbrown_Soliantjbrown_Soliant Posts: 2Questions: 1Answers: 0

Hi all.
I'm looking for a way to add a button to the rowGroup row. I can add text using the startRender, but don't seem to be able to add a button.
Has anyone done this? If so, how did you do it? I've got a decent understanding of JS and of datatables, but am not sure how to do this.
Thanks in advance.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin
    Answer ✓

    You should be able to add a button using rowGroup.startRender. Just have it return the HTML needed:

    $('#myTable').DataTable( {
        rowGroup: {
            startRender: function ( rows, group ) {
                return '... <button>...</button>';
            }
        }
    } );
    

    And have a suitable jQuery event listener for the button.

    Allan

  • jbrown_Soliantjbrown_Soliant Posts: 2Questions: 1Answers: 0

    Thanks Allan. I finally figured that out and it works well.

    I've another question and will post it separately.
    Thanks for responding

    FYI: I tried to click on one of the payment amounts for full access to forum and it didn't work. Will try again today. I'd gladly support your effort in this.

This discussion has been closed.