Re: infinite loop problem :(
| From: | Richard Lynch | Date: | Thu, 12 May 2005 03:23:11 +0000 |
| Subject: | Re: infinite loop problem :( | ||
| References: | 1 2 3 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-5848@lists.php.net to get a copy of this message | ||
On Tue, May 10, 2005 6:55 am, lukas@pronet.lublin.pl said:
> If table have 2000 rows I need to ilustrate this so I must have Clist with
> 2000
> rows so Scrollbar is generated properly but... fetching all 2000 rows from
> database is inefficient beacause there is only part of them visible at one
> time.
Certainly fetching 2000 items to put them in a CList is going to be slow.
But changing the list out from under the user every time they scroll is
going to be *WORSE*.
Sure, you can fill it fast the first time, but you pay the penalty of
re-filling it every time they click, and that's going to be really worse.
What you might consider is:
Send the query to get all 2000 rows, and fill in the number of rows
visible, and display the CList with only that many rows filled in so far.
Then, set up a timer/loop to fill in the rest of the rows, over time, as
the user sits there looking at the first N rows, you are filling in the
rest.
Even as they scroll or whatever, your loop/timer should be filling in more
and more rows in the CList until all 2000 are in there.
This gives the user the ability to see the early rows, and scroll down
while the rest fill in.
Another consideration is this: Is the user likely to know some letters in
the item[s] they are looking for in these 2000? Perhaps a CList of all
2000 is just not the right interface.
Maybe they should have an alphabet across the top for the first character,
and then the CList would change based on the first letter they click on.
Or maybe they could type a few letters from anywhere in the name/string of
what they are looking for, and you present a CList of the matching items.
Very few people want to sit there and scroll through 1247 items to get to
the one they want.
--
Like Music?
http://l-i-e.com/artists.htm