S
S
string152017-10-12 23:55:31
JavaScript
string15, 2017-10-12 23:55:31

How to change data in multiple cells?

Hello.
Please explain how this table works , I need to do the same.
Namely interests how to implement that having changed value of one cell, the data in other cells exchanged.
If it is important, formulas for calculation will come along with the REST data.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Immortal_pony, 2017-10-13
@Immortal_pony

document.querySelectorAll('td input').forEach(function(field) {
    field.addEventListener('change', function() {
        /* Какая-то функция для пересчета данных */
    })
})

A
alvvi, 2017-10-13
@alvvi

Namely interests how to implement that having changed value of one cell, the data in other cells exchanged.

Create a Redux store, shove your table model there in a normalized form, write actions that trigger on changing the value in the cells, write a reducer that will change the model accordingly. Profit.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question