Access VScroll on Table where Collection displayed

Forums for specific tips, techniques and example code
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Access VScroll on Table where Collection displayed

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:30 pm

by Leonie Rae >> Tue, 30 Jan 2001 0:51:01 GMT

I want to access the last entry in a collection that is displayed in a table using the displayCollection method.

The Task:
When the collection is loaded it displays the first entry in the top row with the vScroll at the top of the scroll area.

I want to show the user the last entry made in the collection at the bottom oth the table with the vScroll at the bottom of the scroll area, so if the user wishes to view what is above the scroll is moved upwards.

The Problem:
When displaying a collection in a table it only displays say 13 ( dependent on the design height of the table). The vertical scroll is determined by the topRow property of the table.
When you scroll down the above entries are discarded and other entries are added. So there are only ever 13 rows in the table.

There appears to be no way to access the vertical scroll or to reverse the way a table handles the displayCollection method.

There is a performance issue if the entire collection is loaded into the table.

Any thought would be kindly appreciated.

Regards
Leonie Rae

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Access VScroll on Table where Collection displayed

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:30 pm

by Craig Shearer >> Tue, 30 Jan 2001 1:13:37 GMT

Hi Leonie

Here are my thoughts...

Firstly, if you want to show the last entry in the collection at the top of the list, the displayCollection method on Table takes a showHow parameter that can be set to 1 to make the collection display in reverse order. So, this might solve your immediate problem.

However, my opinion is that there is a serious gap in the functionality of the Table control with the displayCollection method - in that there is no known way to make it scroll to any arbitrary object in the collection.

You're right there's a performance problem with loading a large collection into a table, and so virtualising the table (which displayCollection achieves) is a good idea. However, as you have discovered, it's missing a vital piece of functionality. One can only hope that this will be rectified soon!

For now, I personally have a subclassed Table control that I wrote that does all the virtualising in a similar manner to the displayCollection method on Table, but it has a method that allows me to position its iterator at whatever point in the collection I want, and thus make the Table scroll to any object.

I believe that the Erewhon demo system (on the 5.1.8 CD or downloadable from the JADE website) has a subclassed Table control that does this sort of virtualisation - you could take a look at this code and use it, though I'm not sure whether it has any inbuilt functionality to scroll to a particular object. This it wouldn't be difficult to add though.

Hope this helps,
Regards,
Craig.


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 17 guests

cron