When you search all rows in the table will be searched even if there are an inital filter as default. It’s possible to keep/preserve the filter you have defined when searching.
Original
SR. | NAME | GENDER | AGE | DATE | COUNTRY |
---|---|---|---|---|---|
1 | Dett2 | Female | 36 | 16/08/2020 | Great Britain |
2 | Nern | Female | 19 | 15/10/2017 | France |
3 | Kallsie | Male | 20 | 16/08/2016 | France |
4 | Siuau | Female | 21 | 21/05/2015 | Great Britain |
5 | Shennice | Male | 22 | 21/05/2016 | France |
6 | Chasse | Female | 23 | 15/10/2018 | France |
7 | Tommye | Male | 24 | 16/08/2017 | United States |
8 | Dorcast | Female | 25 | 21/05/2016 | United States |
9 | Angelee | Male | 26 | 21/05/2017 | Great Britain |
10 | Willoom | Female | 26 | 15/10/2019 | France |
This example below shows all females that are 19 or older.
Shortcode
[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" filter_col="Gender,Age" filter_data="Female,19" filter_criterias="Gender,Age" filter_operator="equals,mequal"]
SR. | NAME | GENDER | AGE | DATE | COUNTRY |
---|---|---|---|---|---|
1 | Dett2 | Female | 36 | 16/08/2020 | Great Britain |
2 | Nern | Female | 19 | 15/10/2017 | France |
4 | Siuau | Female | 21 | 21/05/2015 | Great Britain |
6 | Chasse | Female | 23 | 15/10/2018 | France |
8 | Dorcast | Female | 25 | 21/05/2016 | United States |
10 | Willoom | Female | 26 | 15/10/2019 | France |
If you add search functionality to the table, search for Kallsie and you hit the searchbutton you will see this (because all rows in the table are searched – the filter that you have you have defined before is ignored):
SR. | NAME | GENDER | AGE | DATE | COUNTRY |
---|---|---|---|---|---|
3 | Kallsie | Male | 20 | 16/08/2016 | France |
If you want to preserve filter while searching, you have to add preservefilter_search=”yes” to the shortcode. When you do this only values are searched in columns that are not defined in your filter (In this case search is not done in columns Gender and Age).
Shortcode
[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" preservefilter_search="yes" filter_col="gender,age" filter_data="Female,19" filter_criterias="Gender,Age" filter_operator="equals,mequal"]
If you do the same search again (Kallsie) no rows will display because Kallsie isn’t valid within the range of the filter you have defined (females with age 19 or older). Kallsie is a male.
SR. | NAME | GENDER | AGE | DATE | COUNTRY |
---|
If you on other hand search for Dorcast you will see this row (because the search are valid within the filter you defined – females that are 19 or older):
SR. | NAME | GENDER | AGE | DATE | COUNTRY |
---|---|---|---|---|---|
8 | Dorcast | Female | 25 | 21/05/2016 | United States |
Try it yourself with above table and filter
:
Preserve filter off (default):
SR. | NAME | GENDER | AGE | DATE | COUNTRY |
---|---|---|---|---|---|
1 | Dett2 | Female | 36 | 16/08/2020 | Great Britain |
2 | Nern | Female | 19 | 15/10/2017 | France |
4 | Siuau | Female | 21 | 21/05/2015 | Great Britain |
6 | Chasse | Female | 23 | 15/10/2018 | France |
8 | Dorcast | Female | 25 | 21/05/2016 | United States |
10 | Willoom | Female | 26 | 15/10/2019 | France |
Preserve filter on:
SR. | NAME | GENDER | AGE | DATE | COUNTRY |
---|---|---|---|---|---|
1 | Dett2 | Female | 36 | 16/08/2020 | Great Britain |
2 | Nern | Female | 19 | 15/10/2017 | France |
4 | Siuau | Female | 21 | 21/05/2015 | Great Britain |
6 | Chasse | Female | 23 | 15/10/2018 | France |
8 | Dorcast | Female | 25 | 21/05/2016 | United States |
10 | Willoom | Female | 26 | 15/10/2019 | France |