Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

242
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda