T
T
TRactor2018-04-20 23:41:16
Angular
TRactor, 2018-04-20 23:41:16

Angular not updating table, how to filter on input[checkbox] click?

Can you please tell me how to implement filtering by selected checkboxes?
I can’t figure out why it doesn’t work correctly, i.e. it is filtered only during initialization... when pressed, the value of the object for filtering changes... but does not update the table. Here is a project on StackBlitz I build a
table from the received data with json ...
Options should be based on the data. Those. in the gender filter, for example, there are two options: female and male. The departament field contains all possible departments.
The options are checkbox [Filter Value]
For example, when you click on the checkbox, the table should be filtered by the corresponding value, while all other filters should be recalculated.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-04-21
@TRactor

when clicked, the value of the object changes for filtering ... but does not update the table

As the pure pipe documentation says:
Probably, the FilterdataPipe should be made impure.
In addition, the filtering itself - I don’t even know what to say, is so crazy.
Well, you also have the name of one of the properties - department, and the corresponding filter is called depart a ment (a came out from somewhere after the first t). And it’s also not clear with city - the property is nested, you don’t know what to do, so you didn’t even start implementing the corresponding filter?
As far as I understood, you need something like this , right?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question