Page 1 of 1

About creating a filter on list page opening

Posted: Mon Aug 01, 2022 1:41 am
by mavel

Hi,

in the sidebar menu item i create a filter like this:
(to filter records on page opening)

function Page_Load() {

     if(empty($_GET)){
        
         header("location: purchaseslist?x_Status=1&y_Status=5&z_Status=BETWEEN&cmd=search");
         return false;
     }
}

How can I add the filter using server events without adding it to the menu with this method?
When I filter with the Recordset_Selecting server event, I cannot clear the filter to show all records.
What I want to do is to create a filter on the list page opening and to be able to show all records when I click show all from the search tools.


Re: About creating a filter on list page opening

Posted: Mon Aug 01, 2022 7:53 am
by mobhar

mavel wrote:

to create a filter on the list page opening and to be able to show all records when I click show all from the search tools.

You cannot do that. When you have already defined your own filter in Recordset_Selecting server event, then the recordset that returned from that event will always be used as initial recordset in your List page.


Re: About creating a filter on list page opening

Posted: Mon Aug 01, 2022 6:29 pm
by mavel

But I can't temporarily create a filter on this server event. The filtered data is being filtered permanently and the show all records option doesn't work. I have over 1000 data records and I don't want to show completed jobs on list page opening. The application needs a server event where we can create temporary filters. My method is not a healthy method.


Re: About creating a filter on list page opening

Posted: Mon Aug 01, 2022 6:57 pm
by mobhar

mavel wrote:

The filtered data is being filtered permanently and the show all records option doesn't work.

That's the Recorset_Selecting server event made for. You cannot display all records after doing filter in Recordset_Selecting server event.