I have three dropdown
boxes. I need to filter the data and need to be displayed in the table based on my checkbox selection(either with single checkbox
or two checkboxes
or three checkboxes
).
I have done the following, but if we observe it clearly, I am not able to filter the data properly using AngularJS
.
Like:
a. It should work for individual checkbox selection
: means if I select any single checkbox
either from Name
or Description
or Field4
, then respective matched filtered data should be displayed in the table, otherwise it shouldn't be displayed any data(i.e if it doesn't match our checkbox selection means it won't display any data)
b. It should work for multiple(two) checkbox selection
: means if I select any multiple checkboxes like either one from Name
and one from Description
or
one from Description
and one from Field4
or
one from Field4
and one from Name
, then respective matched filtered data should be displayed in the table, otherwise it shouldn't be displayed any data(i.e if it doesn't match our checkbox selection means it won't display any data)
c. It should work for multiple(three) checkbox selection
: means if I select the three checkboxes like one from Name
and one from Description
and one from Field4
, then respective matched filtered data should be displayed in the table, otherwise it shouldn't be displayed any data(i.e if it doesn't match our checkbox selection means it won't display any data)
It is working fine for the first time checkbox
selection only, means: after loading the above code/app, if we check
either any one of the above selections(like whether single checkbox
selection or two checkbox
selection or three checkbox
selection) then it's working fine, later it is not working(means if we uncheck
the above any criteria and then if we select any checkbox
again then it's not working, for that again we need to refresh the app/code then only it's working).
Example: if I select one from Name, then respective matched data will be displayed. Then again if I uncheck
the same and check
the some other checkbox
like from Description
then it's not working. Similarly for all the above criteria. You can observe
it clearly.
Please let me know that what I have done wrong here and let me know how to filter it properly. Created Fiddle. Thanks in advance !