Skip to content

sum column data #408

@denys-correia

Description

@denys-correia

Good afternoon, I'm trying to sum column data, but I always get the same error. Someone has an idea how to do this.

I've tried something like:

        const rowClasses = (row, rowIndex) => {
            if (row.status !== "Cancelado" && row.pagrec === "Pagamento"){
                var value = row.vlfinal;
                this.setState({amount: this.state.amount += value});
                return;

            }
        };
 <BootstrapTable
                                noDataIndication="X"
                                striped keyField='id' data={data} columns={columns}
                                rowStyle={rowStyle}
                                rowClasses={rowClasses} />

I get the error:

index.js:2178 Warning: Cannot update during an existing state transition (such as within renderor another component's constructor). Render methods should be a pure function of props and state; constructor side-effects are an anti-pattern, but can be moved tocomponentWillMount.

Any suggestion would be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions