Arc Server 10 FlexViewer 2.3.1
Hello, I'm upgrading a customized FlexViewer application from FlexViewer 1.3 to Flexviewer 2.3.1.
In the version of the FlexViewer 1.3 we implemented the Table Of Content that appears on this threads:
http://forums.esri.com/Thread.asp?c=158&f=2421&t=302802#947017
The link to the code source has been redirected and I can't find it anymore.
This Table of Content for 1.3 has an interesting functionality:
When the users turn on a child within a GroupLayer, the event is spread in the tree and the parents are automatically turned on. So the user can target what he want to see on the map without worrying about turning-on the all tree hierarchy.
I'm using now the Table Of Content implemented by Robert Scheitlin.
I tried to recreate this functionality. I try to understand how the "tocClasses" classes work together, but it's really complicated. I compare the "tocClasses" code in 1.3 and 2.3.1 but it's not successful yet.
Has anyone implemented this kind of functionality?
Thanks,
Matt
Matt
private function onCheckBoxClick(event:MouseEvent):void { event.stopPropagation(); if (data is TocItem) { var item:TocItem = TocItem(data); do { item.visible = _checkbox.selected; if (item.isTopLevel() == true){ break; } else { item = item.parent } } while (item.visible == false); } }
private function toggleChildren(item:TocItem):void { for each (var subitem:TocItem in item.children){ subitem.visible = _checkbox.selected; if (subitem.children){ toggleChildren(subitem); } } } private function onCheckBoxClick(event:MouseEvent):void { event.stopPropagation(); if (data is TocItem) { var item:TocItem = TocItem(data); var runonce:Boolean = false do { item.visible = _checkbox.selected; if (runonce == false){ toggleChildren(item); } if (item.isTopLevel() == true){ break; } else { runonce = true item = item.parent } } while (item.visible == false); } }
private function toggleChildren(item:TocItem):void { for each (var subitem:TocItem in item.children){ subitem.visible = _checkbox.selected; if (subitem.children){ toggleChildren(subitem); } } } private function onCheckBoxClick(event:MouseEvent):void { event.stopPropagation(); if (data is TocItem) { var item:TocItem = TocItem(data); do { item.visible = _checkbox.selected; if (item.isTopLevel() == true){ break; } else { item = item.parent } } while (item.visible == false); } } private function onCheckBoxDoubleClick(event:MouseEvent):void { event.stopPropagation(); if (data is TocItem) { var item:TocItem = TocItem(data); var runonce:Boolean = false do { item.visible = _checkbox.selected; if (runonce == false){ toggleChildren(item); } if (item.isTopLevel() == true){ break; } else { runonce = true item = item.parent } } while (item.visible == false); } }