G
G
gotohell2017-07-13 06:48:36
JavaScript
gotohell, 2017-07-13 06:48:36

Is the filter within acceptable limits?

There is a table with data, all data is entered in the data* attribute, almost all of them are in the range of their values, for example, from 220 to 1700. I filter this data using jquery.
The data is filtered but only by the first cell.
062dba220d8e43aca1d0447269dd20c7.jpg
I would like to make it so that when you enter data, it would filter all cells and leave the cell where there are valid values, that is, if there are cells with data from 220 to 1700, from 100 to 600 and a cell without a range of 0.37 and we enter, say, " 300", "450" ​​and "0.37" then it would output this:
5444cf11fb154eb5aa0ac926bb497569.jpg
That is, the data doesn't have to be exact, it has to be within the allowed range.

https://codepen.io/webmasterotboga/pen/yXZJRM

Thank you all!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vanya2h, 2017-07-13
@vanya2h

First of all, the data must be in the form of an array of objects. Create an onChange event for the inputs. In the callback, you save the entered data in some kind of storage (in the form of an object with 3 parameters). Render columns based on what dataset is in the 3-parameter object using the Array.filter() function.
That is, every time the state of one of the inputs changes, you run a function that updates the display parameters (an object with 3 parameters) and the page re-renders the column

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question