dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: detecting end of list

  1. #1
    Junior Member
    Join Date
    Sep 2009
    Posts
    3

    detecting end of list

    Hi

    I am trying to implement paged recordsets in a datagrid and since I've not been able to find a way as a standard feature of as3 (recordset type was not provided in as3) - I'm cooking my own.

    The only problem I have is knowing when additional records should be requested. I need to be able to tell when the scroll bar or other method is used to scroll the datagrid down to the end (or near the end).

    I have not found any kind of "end of list" event.

    Can anyone offer advice on this ?
    Thanks
    gmax

  2. #2
    newb of many sorts Ralgoth's Avatar
    Join Date
    Apr 2002
    Posts
    466
    if you're using the ScrollBar class, or any related classes, then you can check the .scrollPosition property to see if the user is near the end of the list.

    additionally, you can add an event listener to check whenever someone scrolls...

    PHP Code:
    myScrollBar.addEventListener(ScrollEvent.SCROLLcheckPosition);

    function 
    checkPosition(event:ScrollEvent):void
    {
       
    trace(event.target.scrollPosition);

    Search first, asked questions later.

  3. #3
    Junior Member
    Join Date
    Sep 2009
    Posts
    3
    OK Thanks for the suggestion. but.....

    I get an error:


    1069: Property scrollPosition not found on fl.controls.DataGrid and there is no default value.

    I looked at the DataGrid class definition which says:

    The DataGrid component is composed of subcomponents including ScrollBar, HeaderRenderer, CellRenderer, DataGridCellEditor, and ColumnDivider components, all of which can be skinned during authoring or at run time.

    I cant find a property that will let me access the properties of the scroll bar component in the datagrid.


    Is it possible to do this with DataGrid ?

  4. #4
    newb of many sorts Ralgoth's Avatar
    Join Date
    Apr 2002
    Posts
    466
    it's a descendant of BaseScrollPane, not ScrollBar...

    try .horizontalScrollPosition and .verticalScrollPosition
    Search first, asked questions later.

  5. #5
    Junior Member
    Join Date
    Sep 2009
    Posts
    3
    Quote Originally Posted by Ralgoth View Post
    it's a descendant of BaseScrollPane, not ScrollBar...

    try .horizontalScrollPosition and .verticalScrollPosition

    That is precisely what i needed. Thanks Ralgoth. QED.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center