This topic is locked

Initialize Column Filter with not all dropdown items

2/7/2024 11:35:21 AM
ASPRunner.NET General questions
E
Edward K. author

Hi,

I have a Dropdown filter on my page, what would be the recommend way to initialize that dropdown box with only a select number of check boxes?

I would like to have the intialize page load only show these two statuses (Active and Active-Website).

Once loaded the user can come back to the filter dropdown and select all if the choose.

img alt

Edward K.
https://appsdeveloped.com

Sergey Kornilov 2/7/2024

Here is what I can suggest. You can click this filter column, select the initial values you looking for and filter the list. Note the URL. You can now redirect user to this filter page on the initial page load.

E
Edward K. author 2/8/2024

Hi,

I did try that however the url did not change. What about adding some code to the events? If so which event?

Best Regards,

img alt

img alt

Thanks!

Edward K.
https://appsdeveloped.com

Sergey Kornilov 2/10/2024

You are right, in this specific case we send variables via POST and you won't see them in the URL. You still can mimic this behaviour, it is just going to be more tricky.

Open Chrome Developer Tools (F12), proceed tot he Network tab, set the required column filter and find the request to that list page. Find 'Payload' tab, switch to 'view source' like on the screenshot below. This what you need to add to your URL.

img alt

So the URL that you need to load initially will be something like this:
custoners_list.php?fieldFilter=%7B%22updateFieldFilterValues%22%3Atrue%2C%22clearFilter%22%3Afalse%2C%22field%22%3A%22Country%22%2C%22values%22%3A%22%5B%5C%22Spain%5C%22%2C%5C%22Austria%5C%22%5D%22%2C%22addToExisting%22%3Afalse%7D

E
Edward K. author 2/12/2024

OK Thanks!