Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in collapse function of Actions tables #2724

Closed
anonymous-matomo-user opened this issue Oct 19, 2011 · 3 comments
Closed

Bug in collapse function of Actions tables #2724

anonymous-matomo-user opened this issue Oct 19, 2011 · 3 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@anonymous-matomo-user
Copy link

Recently I found one issue related to on click collapse function on Actions tables.
If we look at code in plugins/CoreHome/datatable.js for collapse function:

// we add an attribute parent that contains the ID of all the parent categories
// this ID is used when collapsing a parent row, it searches for all children rows
// which 'parent' attribute's value contains the collapsed row ID
$(this).attr('parent', function(){
return self.parentAttributeParent + ' ' + self.parentId;
}

For example, parent row id=166 and one of the children rows of this parent row id =66.
When we click on row with id=66 to collapse all its children, as its siblings parent id contains 66 (actually it is 166), so it is collapsing its siblings as well along with its children. This was happened in my case only, by debugging js code, I came to know that below piece of code making the issue:

if(parents.indexOf(idSubTable) >= 0
|| parents.indexOf('subDataTable_'+idSubTable) >= 0)
{
Collapse this element
}

@mattab
Copy link
Member

mattab commented Dec 24, 2011

A similar bug was reported in #1474

@mattab
Copy link
Member

mattab commented Aug 7, 2012

Thank you for taking a look at this long standing bug!

@diosmosis
Copy link
Member

(In [7817]) Fixes #2724, split parent ID list and use Array.indexOf instead of String.indexOf when collapsing datatable tree node so collapsing row w/ id '66' does not result in closing row w/ id '166'. Thanks to nsony for very descriptive bug report!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

3 participants