[flexcoders] Re: Datagrid scrolling woes!
I'm having a very similar problem with a list control. I have a data model that has a cursor position that my list binds to, i.e. mx:List width=200 height=100 dataProvider={dataModel} selectedIndex={dataModel.cursorPos}/ When I refresh my data model it automatically scrolls me back to the top of the list, it keeps my selectedIndex correct but if it is a higher number than the viewed items it will be off of the viewed area. I tried adding in verticalScrollPosition={dataModel.cursorPos} but it acts even stranger. It still scrolls me to the top of my list and adds a few empty lines at the top. I am wondering if the scrollToIndex method will help with this and was wondering if anyone else had come up with an easy solution to this. Ethan
[flexcoders] Re: Datagrid scrolling woes!
I don't know if you're just trying to be misleading, or mis-typed something, but it doesn't help any if you're passing wrong information. DataGrid (or List for that matter) doesn't have a vPosition property at all. I don't know the answer for sure, but there's a 'scrollPosition' property on dataGrid.verticalScrollBar ... thats the one I'd look at first. good luck. PW --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: For DataGrid, setting vPosition=myrowIndex will scroll the grid to the desired line. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Cameron Ray Sent: Wednesday, December 20, 2006 6:29 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Datagrid scrolling woes! Hello all, I'm trying to accomplish something that is seemingly easybut is driving me bananas due to the fact that it's not working. I want to setup a function that can be called and that function will scroll my datagrid to a specific row within that datagrid. Here's what I've got (that doesn't work)any thoughts? _ public function scrollDG():void { dgUserRequest.editedItemPosition = {columnIndex:0, rowIndex:dgUserRequest.dataProvider.length-1}; } ]] /mx:Script mx:Button label=Scroll click=scrollDG()/ mx:Text text={app.userInfo.firstname}'s Videos/ mx:DataGrid id=dgUserRequest x=22 y=128 dataProvider={app.vidInfo2} width=850 height=700 headerStyleName=headerStyle mx:columns mx:DataGridColumn headerText=Thumbnail dataField=thumb_name itemRenderer=components.dgRenderImage width=104/ mx:DataGridColumn headerText=Video Title dataField=projectname id=title fontWeight=bold paddingLeft=10/ mx:itemRenderer mx:Component mx:VBox verticalAlign=middle mx:Text text={data.projectname}/ /mx:VBox /mx:Component /mx:itemRenderer /mx:DataGridColumn mx:DataGridColumn headerText= dataField=projectid itemRenderer=components.dgEditProject width=120/ mx:DataGridColumn headerText=Last Modified dataField=lastmodified itemRenderer=components.dgLastMod width=150/ mx:DataGridColumn headerText= dataField=projectid itemRenderer=components.dgDeleteProject width=75/ /mx:columns /mx:DataGrid Thanks for the help. -Cameron
RE: [flexcoders] Re: Datagrid scrolling woes!
Oops, maybe that was 1.5. I'll check a bit. And all my advice comes with a money-back warranty! Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of parkerwhirlow Sent: Thursday, December 21, 2006 12:14 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Datagrid scrolling woes! I don't know if you're just trying to be misleading, or mis-typed something, but it doesn't help any if you're passing wrong information. DataGrid (or List for that matter) doesn't have a vPosition property at all. I don't know the answer for sure, but there's a 'scrollPosition' property on dataGrid.verticalScrollBar ... thats the one I'd look at first. good luck. PW --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Tracy Spratt [EMAIL PROTECTED] wrote: For DataGrid, setting vPosition=myrowIndex will scroll the grid to the desired line. Tracy From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Cameron Ray Sent: Wednesday, December 20, 2006 6:29 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Datagrid scrolling woes! Hello all, I'm trying to accomplish something that is seemingly easybut is driving me bananas due to the fact that it's not working. I want to setup a function that can be called and that function will scroll my datagrid to a specific row within that datagrid. Here's what I've got (that doesn't work)any thoughts? _ public function scrollDG():void { dgUserRequest.editedItemPosition = {columnIndex:0, rowIndex:dgUserRequest.dataProvider.length-1}; } ]] /mx:Script mx:Button label=Scroll click=scrollDG()/ mx:Text text={app.userInfo.firstname}'s Videos/ mx:DataGrid id=dgUserRequest x=22 y=128 dataProvider={app.vidInfo2} width=850 height=700 headerStyleName=headerStyle mx:columns mx:DataGridColumn headerText=Thumbnail dataField=thumb_name itemRenderer=components.dgRenderImage width=104/ mx:DataGridColumn headerText=Video Title dataField=projectname id=title fontWeight=bold paddingLeft=10/ mx:itemRenderer mx:Component mx:VBox verticalAlign=middle mx:Text text={data.projectname}/ /mx:VBox /mx:Component /mx:itemRenderer /mx:DataGridColumn mx:DataGridColumn headerText= dataField=projectid itemRenderer=components.dgEditProject width=120/ mx:DataGridColumn headerText=Last Modified dataField=lastmodified itemRenderer=components.dgLastMod width=150/ mx:DataGridColumn headerText= dataField=projectid itemRenderer=components.dgDeleteProject width=75/ /mx:columns /mx:DataGrid __ Thanks for the help. -Cameron
RE: [flexcoders] Re: Datagrid scrolling woes!
Ok, its verticalScrollPosition in 2.0. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of parkerwhirlow Sent: Thursday, December 21, 2006 12:14 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Datagrid scrolling woes! I don't know if you're just trying to be misleading, or mis-typed something, but it doesn't help any if you're passing wrong information. DataGrid (or List for that matter) doesn't have a vPosition property at all. I don't know the answer for sure, but there's a 'scrollPosition' property on dataGrid.verticalScrollBar ... thats the one I'd look at first. good luck. PW --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Tracy Spratt [EMAIL PROTECTED] wrote: For DataGrid, setting vPosition=myrowIndex will scroll the grid to the desired line. Tracy From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Cameron Ray Sent: Wednesday, December 20, 2006 6:29 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Datagrid scrolling woes! Hello all, I'm trying to accomplish something that is seemingly easybut is driving me bananas due to the fact that it's not working. I want to setup a function that can be called and that function will scroll my datagrid to a specific row within that datagrid. Here's what I've got (that doesn't work)any thoughts? _ public function scrollDG():void { dgUserRequest.editedItemPosition = {columnIndex:0, rowIndex:dgUserRequest.dataProvider.length-1}; } ]] /mx:Script mx:Button label=Scroll click=scrollDG()/ mx:Text text={app.userInfo.firstname}'s Videos/ mx:DataGrid id=dgUserRequest x=22 y=128 dataProvider={app.vidInfo2} width=850 height=700 headerStyleName=headerStyle mx:columns mx:DataGridColumn headerText=Thumbnail dataField=thumb_name itemRenderer=components.dgRenderImage width=104/ mx:DataGridColumn headerText=Video Title dataField=projectname id=title fontWeight=bold paddingLeft=10/ mx:itemRenderer mx:Component mx:VBox verticalAlign=middle mx:Text text={data.projectname}/ /mx:VBox /mx:Component /mx:itemRenderer /mx:DataGridColumn mx:DataGridColumn headerText= dataField=projectid itemRenderer=components.dgEditProject width=120/ mx:DataGridColumn headerText=Last Modified dataField=lastmodified itemRenderer=components.dgLastMod width=150/ mx:DataGridColumn headerText= dataField=projectid itemRenderer=components.dgDeleteProject width=75/ /mx:columns /mx:DataGrid __ Thanks for the help. -Cameron