How can I Update which Columns are used for Groups?

How can I Update which Columns are used for Groups?

redwallredwall Posts: 11Questions: 1Answers: 0

Hi,

I am using the grouping plugin here http://jquery-datatables-row-grouping.googlecode.com/svn/trunk/index.html to do 2 level grouping.

When I initialize datatables I set manually the columns that I want to set as follows

iGroupingColumnIndex: 0,
iGroupingColumnIndex2: 2,

It works great. However I have a button on the side which act like a switch for changing what to group.

I have a click event as so

$('.changeGroup').click(function(){
    $('.myTable').dataTable().rowGrouping({ 
        iGroupingColumnIndex: 2, // First Column to Sort
        iGroupingColumnIndex2: 0, // Second Column to Sort
});
});

This does not work, I am not sure if I need to pass in the parameters and redraw the entire table again.

Any help appreciated on how to dynamically update these options in the table.

Best, Red

This discussion has been closed.