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

184
Visualizações
Table shows wrong data after 11th column and row

I think everything is fine with the code its just like a 2D array indexing like the row column values. The error is for 110- it is supposed to assume like row-1 column-10 but in this case it is assuming like row-11 column -0 only this is the issue I think And this happening only when maxrows were given as 100 its maxrows were given as 10 its working fine

jsonTable = (dataValue, datalabel): JSX.Element[] => {
        const table: JSX.Element[] = [];
        const children: JSX.Element[] = [];
        const { setting } = this.state;
        let maxRow = setting?.maxRows;
        let sort = setting?.sortKey;
        for (let index = 0; index < datalabel.length; index++) {
            if (index !== (sort - 1)) {
                const idValue = datalabel[index] + index
                children.push(
                    <th className ={ this.constant.check}
                        style = {{ fontSize: setting?.fontSize }}
                        onClick = {this.partial(this.sortData, datalabel[index], index)} >
                        <span
                            className={this.constant.headerClass}><span className={this.constant.ColumnText}>{datalabel[index]}</span>
                            <span className={this.constant.SortIndicator}>
                                <img
                                    className={this.constant.image} id={idValue}
                                    src={this.imageUp} alt={this.constant.altImage} /></span></span>
                    </th>
                );
            }
            else {
                const idValue = datalabel[index] + index
                children.push(
                    <th className={this.constant.check}
                        style={{ fontSize: setting?.fontSize }}
                        onClick={this.partial(this.sortData, datalabel[index], index)} >
                        <span
                            className={this.constant.headerClass}><span className={this.constant.ColumnText}>{datalabel[index]}</span>
                            <span className={this.constant.SortIndicator}>
                                <img
                                    className={this.constant.image1} id={idValue}
                                    src={this.imageUp} alt={this.constant.altImage} />
                                    </span></span>
                    </th>
                );
            }
        }
        table.push(<tr>{children}</tr>)
        for (let index = 0; index < dataValue.length; index++) {
            const idValue = this.constant.tr + index
            index < maxRow ? table.push(
                <tr
                    id={idValue}
                    key={idValue}
                    className={this.constant.tableRow}
                    style={{ display: this.constant.tablerow, fontSize: setting?.fontSize }}>
                    {this.bodyElement(datalabel, dataValue, index)}</tr>) : null
        }
        return table;
    }
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