jiangtiandao / flexlib

Automatically exported from code.google.com/p/flexlib
0 stars 0 forks source link

TreeGrid component: Inconsistency in API and bug in openAllItems #228

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello, 

I've noted the following issues on the TreeGrid component:

- Component exposes a closeAllItems method, but not openAllItems
- openItemAt implementation has a bug, requiring the item parameter to be 
set, even though the signature function suggests it is optional. c.f issues 
56 and 170
- Even by adding the openAllItems function, it is not trivial to get to tree 
to be fully expanded when data provider is set or changed.

Here's a suggested patch to fix both these issues:
- fix the openItemAt function by looking up item by row before adding it to 
openItems
- adds the openAllItems function, whose implementation is similar to 
closeAllItems
- Adds null pointer checks in both closeItemAt and openItemAt (component was 
assuming _dataDescriptor.getChildren(item) is never returning null)
- adds an "openByDefault" inspectable attribute defaulting to false so 
developpers can decide whether the tree should be displayed fully opened.

Please let me know if there is any issue with the patch, I'm willing to 
modify as needed to fit FlexLib's coding standards.

Original issue reported on code.google.com by olarivain@gmail.com on 17 Jun 2009 at 7:40

Attachments: