Need to know efficient way to populate list boxes

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

Need to know efficient way to populate list boxes

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

by Derek Gerrard >> Mon, 27 Nov 2000 6:48:42 GMT

I am loading data into a list box which covers 3 item levels in its hierarchy. I am using an iterative process through MKD's to set this up but it takes about 50 secs to load.

I have tried introducing a scroll bar and only loading items that are visible in the window but this causes 2 problem: 1. When the hierarchy is expanded the list box generates its automatic scroll bar meaning I have 2 scroll bars next to the list box. 2. My understanding is that scroll bars in Jade cannot be used on web pages anyway as this application will need to be.

Any ideas??

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

Re: Need to know efficient way to populate list boxes

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

by Graeme Joyce >> Mon, 27 Nov 2000 20:08:12 GMT

Derek

To solve this problem I built a hierachical listbox which only loads each level as required ie when "+" is clicked, or when the app needs to display a specific entry.

To get the "+" to display beside parent entries that have children that aren't yet loaded I place a dummy entry underneath the parent, then delete the dummy if/when the real children are loaded. I tried playing with the listbox's "itemPictureType" property to get the "+" to display for unloaded levels, but the problem with this is once you have set it manually once, you have to continue controlling it manually for all time.

Its been in production for a year now with the only real problem being that once a level gets a few 1000 entries it still takes a while to load. There's probably potential for combining this "load when clicked" concept with the "only load items that are visible" approach you have been experimenting with.

Graeme.


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 28 guests