JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 14th, 2007, 10:55 AM
Nemi Nemi is offline
Clueless llama
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Feb 2001
Location: Lincoln, NE. USA
Posts: 2,353 Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 12 h 39 m 5 sec
Reputation Power: 116
Alternative for Select tag with thousands of options?

I have a select tag that is dynamically created for users that log into my web app. Some users can have 2000-8000 options in the select tag, and there can be multiple select tags on the page. Each select tag can add almost a meg of information to the page.

The problem I have been running into is not the file size, but the time it takes the browser to render once it has gotten the information. Plus, I had it so users can dynamically add more "funds" (in this case) by clicking a button and it would clone the table the select is in and make a new one for them to choose another fund out of, but when the user has that many funds, it takes 5 seconds or more on my pc (which is pretty fast) to render the cloned node, which is clearly unacceptable.

Has anyone else run into this problem and come up with an alternative?
__________________
~Nemi

Before posting did you try:
[ Javadocs | Google ]

Reply With Quote
  #2  
Old May 14th, 2007, 12:15 PM
Ebot's Avatar
Ebot Ebot is offline
Meatball Surgeon
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 2004
Location: Elbow deep in code
Posts: 2,056 Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)Ebot User rank is General 5th Grade (Above 100000 Reputation Level)  Folding Points: 87885 Folding Title: Advanced FolderFolding Points: 87885 Folding Title: Advanced FolderFolding Points: 87885 Folding Title: Advanced FolderFolding Points: 87885 Folding Title: Advanced FolderFolding Points: 87885 Folding Title: Advanced Folder
Time spent in forums: 2 Weeks 3 Days 7 h 58 m 28 sec
Reputation Power: 1319
Man, thats a lot of data for javascript to be handling....

So there are multiple select tags, but each select statement is a single select? if that so, i have an easy one for you. Don't loop thru your data to select the right record, just add it to the end as a new option. yes, you will duplicate data on the dropdown, but you should save a TON of processing time and also it won't matter which value they select, it will work with either one.
__________________
Three gigs for the secretaries fair
Seven gigs for the system source
Nine gigs for the coders in smoky lairs
One disk to rule them all, one disk to bind them
One disk to hold the files, and in the darkness grind'em
---------------------------------------------------
It is by caffeine alone that I set my mind in motion.
It is by the beans of Java, that my thoughts acquire speed.
The hand acquire shakes; the shakes become a warning.
It is by caffeine alone that I set my mind in motion.

Reply With Quote
  #3  
Old May 14th, 2007, 12:36 PM
Nemi Nemi is offline
Clueless llama
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Feb 2001
Location: Lincoln, NE. USA
Posts: 2,353 Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 12 h 39 m 5 sec
Reputation Power: 116
I'm not sure I explained myself well. The select tags are dynamically created the first time server side, not by the browser. Bad terminology on my part. The browser receives straight, properly formed html initially.

It takes the browser a long time to render the page when it loads PLUS it takes a long time to duplicate the select tag dynamically (in the browser this time using javascript).

I have attached a sample file for anyone that wishes to see an example.
Attached Files
File Type: zip Untitled1.zip (32.0 KB, 52 views)

Last edited by Nemi : May 14th, 2007 at 12:40 PM.

Reply With Quote
  #4  
Old May 14th, 2007, 07:27 PM
ProggerPete ProggerPete is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Brisbane, Australia
Posts: 1,442 ProggerPete User rank is Sergeant (500 - 2000 Reputation Level)ProggerPete User rank is Sergeant (500 - 2000 Reputation Level)ProggerPete User rank is Sergeant (500 - 2000 Reputation Level)ProggerPete User rank is Sergeant (500 - 2000 Reputation Level)ProggerPete User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 1 h 37 m 42 sec
Reputation Power: 28
To find the best solution I think it would pay to look at what the user wants to do on the page and what sort of information they are likely to know etc.

You're demo does demonstrate that it takes a bit to load, but perhaps the best solution is to redesign the interface so the user doesn't have to look at 2000-8000 options.

Honestly, with that many options, if the user doesn't know before he gets to the select box what he wants then the select box isn't going to help him anyway.

Why are you providing them with a select box with so many options? Is it an attempt to avoid typing errors or something? If so just validating their entry is probably a superior method. You could even use an AJAX auto complete script if you felt the need.
Comments on this post
jzd agrees: That is exactly what I was thinking. Instead of looking at how to make this fast, think about is
this even feasible to ask a user to select one of 8000 options.
__________________
Like the answers I give? Why not ask me directly at my forum. I'm always glad to help.

Javascript scripts and tips can be found at Dynamic Tools.
Check out DynamicTable, the best javascript table sorter around.
Get reliable and affordable hosting at www.thinksmarthosting.com

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Alternative for Select tag with thousands of options?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap