Jay Roy
asked on
Expand-Collapse on label click
hi guys
I am trying to impliment a expand-collapse on a label. When label (inside HBox) is clicked, i want the HBox to expand-collapse.
<mx:VBox width="96%" styleName="responseBox">
<mx:HBox id="outerHbox1" width="100%" maxHeight="261">
<mx:Label text="Question 25: Components and Servicess:" creationComplete="expcollL abel(event )" />
</mx:HBox>
<mx:HBox styleName="projAnswerBox" width="100%">
<mx:DataGrid id="dataGrid" width="862">
<mx:columns>
<mx:DataGridColumn headerText="List the name of project" />
<mx:DataGridColumn headerText="Modification" />
<mx:DataGridColumn headerText="Company benefits" />
</mx:columns>
</mx:DataGrid>
</mx:HBox>
</mx:VBox>
private function expcollLabel(event:Event): void {
var label:Label = event.currentTarget as Label;
var titleBar:UIComponent = rte.mx_internal::getTitleT extField() ; --getting error here. ::getTitleBar not found on mx.controls.Label
titleBar.addEventListener( MouseEvent .CLICK, expandCollapseLabel);
expandCollapseLabel(event) ;
}
private function expandCollapseLabel(event: Event):voi d{
var label:Label;
if(event.currentTarget is Label){
label = event.currentTarget as Label;
}else{
label = event.currentTarget.parent as Label;
}
var headerHeight:uint = rte.mx_internal::getHeader HeightProx y();
rte.height = (rte.height == headerHeight ? rte.maxHeight : headerHeight);
}
Am i doing this correctly?
Any help will be appreciated.
thanks.
I am trying to impliment a expand-collapse on a label. When label (inside HBox) is clicked, i want the HBox to expand-collapse.
<mx:VBox width="96%" styleName="responseBox">
<mx:HBox id="outerHbox1" width="100%" maxHeight="261">
<mx:Label text="Question 25: Components and Servicess:" creationComplete="expcollL
</mx:HBox>
<mx:HBox styleName="projAnswerBox" width="100%">
<mx:DataGrid id="dataGrid" width="862">
<mx:columns>
<mx:DataGridColumn headerText="List the name of project" />
<mx:DataGridColumn headerText="Modification" />
<mx:DataGridColumn headerText="Company benefits" />
</mx:columns>
</mx:DataGrid>
</mx:HBox>
</mx:VBox>
private function expcollLabel(event:Event):
var label:Label = event.currentTarget as Label;
var titleBar:UIComponent = rte.mx_internal::getTitleT
titleBar.addEventListener(
expandCollapseLabel(event)
}
private function expandCollapseLabel(event:
var label:Label;
if(event.currentTarget is Label){
label = event.currentTarget as Label;
}else{
label = event.currentTarget.parent
}
var headerHeight:uint = rte.mx_internal::getHeader
rte.height = (rte.height == headerHeight ? rte.maxHeight : headerHeight);
}
Am i doing this correctly?
Any help will be appreciated.
thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
>>>I think I wrote this code
yep, its your code, i was just playing with it and trying to make it work :)
thanks very much brother, you helped me a lot. I am still learning flex. Let me know if i can help you anyway. I know little java, OOPS and spring.
yep, its your code, i was just playing with it and trying to make it work :)
thanks very much brother, you helped me a lot. I am still learning flex. Let me know if i can help you anyway. I know little java, OOPS and spring.
ASKER
hi dgofman:
can you please help me with this question when you have time.
https://www.experts-exchange.com/questions/26981918/populating-data-in-richtext-from-a-For-loop.html?anchorAnswerId=35484128#a35484128
thanks in advance
can you please help me with this question when you have time.
https://www.experts-exchange.com/questions/26981918/populating-data-in-richtext-from-a-For-loop.html?anchorAnswerId=35484128#a35484128
thanks in advance
Open in new window