G
g_meney
Hello,
I am using a web page to update rows in a database. Drawing the full
select for each field for each row can create a very, very large page
to download. Instead i was looking into to drawing a blank <SELECT> for
each field in each row, then fill them from a template at runtime.
Whats the fastest way to copy the options in a select from one select
to another? I am currently populating the options using an array of
data and id values and creating a new Option object :-
<snippet>
var fnOpt = pSelect.options;
n = pArrIDs.length
for(var i=0;i<n;i++)
{
fnOpt[pSelect.length] = new Option(pArrVals, pArrIDs,
false,false);
}
</snippet>
This can take 60+ seconds for 1000 selects (5 per row, 200 rows).
I know that I may need to reduce the number of rows to give it an
acceptable performance, but i was wondering what my options (pardon the
pun) were in populating the <SELECT>. I was looking at :-
* referencing the source options array
* copying the source options array
* cloning the source options array elements
None of these yielded any success so far.
Any help is greatly appreciated.
Thanks,
Gareth.
I am using a web page to update rows in a database. Drawing the full
select for each field for each row can create a very, very large page
to download. Instead i was looking into to drawing a blank <SELECT> for
each field in each row, then fill them from a template at runtime.
Whats the fastest way to copy the options in a select from one select
to another? I am currently populating the options using an array of
data and id values and creating a new Option object :-
<snippet>
var fnOpt = pSelect.options;
n = pArrIDs.length
for(var i=0;i<n;i++)
{
fnOpt[pSelect.length] = new Option(pArrVals, pArrIDs,
false,false);
}
</snippet>
This can take 60+ seconds for 1000 selects (5 per row, 200 rows).
I know that I may need to reduce the number of rows to give it an
acceptable performance, but i was wondering what my options (pardon the
pun) were in populating the <SELECT>. I was looking at :-
* referencing the source options array
* copying the source options array
* cloning the source options array elements
None of these yielded any success so far.
Any help is greatly appreciated.
Thanks,
Gareth.