corrisoft / jquery-datatables-row-grouping

Automatically exported from code.google.com/p/jquery-datatables-row-grouping
0 stars 0 forks source link

Expand/collapse icon display gets messed up when you have two tables on the same page that have the same grouping values #60

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Our application displays two tables on the same page that both use the 
rowGrouping plugin.
Both tables end up having the same grouping values in them like 'Critical', 
'Important', etc.
When we expand/collapse a group in one of the tables, the expand/collapse
icon for the other table changes as well (though the table neither expands
nor collapses).

What is the expected output? What do you see instead?
I expect that I should be able to expand/collapse one table without affecting 
the other table.

What version of the product are you using? On what operating system?
We're currently using the 1.2.7 version of the plugin.

Please provide any additional information below.
It looks like it's marking things as expanded/collapsed based on the data-group 
attribute.
Since both tables have the exact same value there 'critical', both tables get 
updated.
I could not find a way to control the data-group attribute that gets set to 
make it
unique among the two different tables.

Original issue reported on code.google.com by spda...@gmail.com on 11 Jul 2013 at 2:42

GoogleCodeExporter commented 9 years ago
A fix would be to search only inside the original table element. Change the 
lines 280-281 and 308-309 in the functions fnExpandGroup() and 
fnCollapseGroup() to:

$("td[data-group^='" + sGroup + "']", oTable).removeClass("collapsed-group");
$("td[data-group^='" + sGroup + "']", oTable).addClass("expanded-group");

$("td[data-group^='" + sGroup + "']", oTable).removeClass("expanded-group");
$("td[data-group^='" + sGroup + "']", oTable).addClass("collapsed-group");

Original comment by r.leend...@student.tue.nl on 27 Sep 2013 at 8:42