canvas - How to set focus on a Vbox's specific child in flex 4 -
i have vbox contains several grids children. have scroll see grids. there buttons in grids. if press of button, shows children grid's removing grids vbox , fill children of grid's. there button remove children , fill vbox previous grids. when press button want come specific grid clicked see it's child. if @ bottom of scroll when see grid instead of top grid.but shows me top grid. tried setfocus method. not work.
i have canvas root parent , 1 vbox child. , vbox contains grids. , if press button of grid vbox have grid's children explained above. children of grid grids.
please this. pretty stuck in here. in advance :)
setfocus()
method activates component , not scroll viewport. can use
var spdelta:point = datagroup.layout.getscrollpositiondeltatoelement(index); if (spdelta) { datagroup.horizontalscrollposition += spdelta.x; datagroup.verticalscrollposition += spdelta.y; }
where datagroup
can vgroup
.
if doesn't work or not want, can try height of component want bring view , move scroller height
var index:number = datagroup.getelementindex(comp); var offset:number = datagroup.getelementat(index).height; scroller.viewport.verticalscrollposition = index * offset;
where datagroup
vgroup
, comp
data grid want scroll to.
Comments
Post a Comment