Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

243
Visualizações
How can I add a sleep/delay in every 100 records to w2ui grid?

I need a way to add records in a certain cycle(in each cycle I want to add 100 records) to the w2ui grid. However, I do not want to use a for a loop. Instead, I would like to add sleep(or one of its alternatives) in every 100 records. Otherwise, 1000 records are printed at the same time which is not useful for me. One part of my current code is like this:

...
for (let i = 0; i < Object.keys(msgs[j].internal_list).length; i++) {
                    record_entries = {
                        recid: msgs[j].chnl_name + "_" + msgs[j].msg_name + "_" + idx_msgs,
                        chnl_name: msgs[j].chnl_name,
                        msg_name: msgs[j].msg_name,
                        msg_id: msgs[j].msg_id,
                        msg_type: msgs[j].msg_type,
                        can_frame_time: msgs[j].internal_list[i].t,
                        msg_dir: msgs[j].internal_list[i].msg_dir,
                        interval: msgs[j].internal_list[i].interval,
                        min_interval: msgs[j].internal_list[i].min_interval,
                        max_interval: msgs[j].internal_list[i].max_interval,
                        raw_data: msgs[j].internal_list[i].raw_data
                    }
                    if (((idx_msgs % 100) === 0) || ((j === msgs.length - 1) &&
                        (i === Object.keys(msgs[j].internal_list).length - 1) && (idx_msgs >= nums_traces)))
                    {
                        w2ui['can_frame_grid'].add(record_entries);
                        // w2ui['can_frame_grid'].sort('can_frame_time', 'asc');
                    }
                    else
                    {
                        records[idx_msgs] = record_entries;
                    }
                    idx_msgs += 1;
                }
...
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda