How can I access HTML element of individual grouping levels in multilevel grouping.

How can I access HTML element of individual grouping levels in multilevel grouping.

vishal7488vishal7488 Posts: 13Questions: 5Answers: 0

I am using rowGroup extension to group on two different columns. I am then using start render to add a button on the grouped row. I have a requirement to add two different kind of buttons on two grouped rows, but when I am using start render, it is creating same html tag for both the grouped row.

attached is my grouped rows.

rowGroup: {
dataSrc: ['effDa', 'prodClas'],
startRender: function(rows, group) {
var appendClass = readOnlyMode == true ? "hide" : ""
return $('<tr/>')
.append('<td colspan="13"><b>' + group + '<span display:inline-block; style="margin-right: 77.8%";> </span><button type="button" style="margin-left:0px;height: 200x;height: 23px;" class="btn btn-primary delete '+ appendClass +'" id="delete">Add Term</button> </td>')
.attr('data-name', group);
}
},

This question has accepted answers - jump to:

Answers

  • vishal7488vishal7488 Posts: 13Questions: 5Answers: 0

  • kthorngrenkthorngren Posts: 13,131Questions: 25Answers: 3,083
    Answer ✓

    The rowGroup.startRender function has an additional parameter called level. Maybe you can use that to determine the level and which HTML to return.

    Kevin

  • vishal7488vishal7488 Posts: 13Questions: 5Answers: 0

    @kthorngren thanks..it is working as expected. Is there a way to have a expand/collapse functionality in multilevel group. Like a "+" sign or "->" arrow sign

  • kthorngrenkthorngren Posts: 13,131Questions: 25Answers: 3,083
    Answer ✓

    Start with thisexample from this thread.

    Kevin

  • vishal7488vishal7488 Posts: 13Questions: 5Answers: 0

    @kthorngren thanks so much.

Sign In or Register to comment.