List Info

Thread: Re: Dúvida cruel com arrays...




Re: Dúvida cruel com arrays...
country flaguser name
United States
2008-03-03 10:30:11

This is an English-language list. Any chance you can translate so we
can help you?

--Tim Sabin

> Bom é o seguinte...
>
> Eu tenho uma listagem de alunos para cadastro de chamadas do mês:
>;
> aluno[1]
> Presente[1]
> MeioPeriodo[1]
>; Sabado[1]
>
> aluno[2]
> Presente[2]
> MeioPeriodo[2]
>; Sabado[2]
>
> aluno[3]
> Presente[3]
> MeioPeriodo[3]
>; Sabado[3]
> ...
>
> Eu precisaria de uma função que acionando o botao selecionasse por
> exemplo todos os Presente ou MeioPeriodo ou Sabado de todos os
alunos,
> conforme escolha de acordo com a lista de chamadas em mãos.
>
> No submit dessa página, feita em php vou pegar aluno por aluno e
ver
> qual dos 3 foi selecionado, e isso já tenho pronto.
>
> Só preciso mesmo dessa função em javascript.
>
> Alguém pode me ajudar ?
>
>
>
>
>
>
>
> *
> Luciano Marinho*
>
> nickmarinho%40gmail.com">nickmarinhogmail.com <mailto: nickmarinho%40gmail.com">nickmarinhogmail.com>
>; www.lucianomarinho.com.br <http://www.lucianomarinho.com.br/>
>
> *Analista Desenvolvedor Programador PHP/C++*
>
>
>
>
>
> Visit http://aiaiai.com for more groups to join
> Yahoo! Groups Links
&gt;
>
>
>
>

--Tim Sabin

__._,_.___
.

__,_._,___
Speeding up script
country flaguser name
United States
2008-03-03 12:03:59

Greetings gang,

New to the list here! I'm working on an AJAX implementation that queries
the server for data and displays it in a table (I know, big surprise!). I
get the data back fine, but it seems very slow creating the table. I've got
about 8 columns and about 5000 rows (I know, a lot... but the client wants
them all at once!).

I've tried several methods of creating the table, but it's still very slow.
What seems to be the fastest is creating a large array of strings, and then
assigning them to the innerhtml of the div with string.join. Thusly:

function placeData(data) {
var strings = new Array();
strings.push(getTableHead());
for (i = 0; i < data.length; i++) {
strings.push('<TR id="sub' + data[i].ID + '">;');
strings.push(makeSubscriptionRow(data[i]));
strings.push('&lt;/TR>rn');
}
strings.push('</table>');
display = strings.join('');
g_activeDiv.innerHTML = display;
}

When I put alerts between the lines, that last line setting the HTML takes
about 10 seconds. I tried creating DOM objects, which was a lot slower and
just a single string, which was a little slower, but it's still over 10
seconds.

Is there a faster way to do this, or do I just need to convince the client
to go to a paging implementation?

-D. Israel
dan%40ebji.org">danebji.org
http://www.customcodebydan.com
AIM: JudoDanIzz

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )