SPM and default filters

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
SSchimkat
Veteran Member
Posts: 31
Joined: 2018-01-04 18:49

SPM and default filters

Post by SSchimkat » 2018-10-08 17:26

Hi everyone

Just installed the Search Page Maker .. but ran into troubles with my default filters. The following default filters works just fine without the SPM:

Code: Select all

                $options->DefaultSortField = '7 asc, 12 asc';
                $options->DefaultSortDirection = '';

                if(!$_POST['FilterField'][1] && !$_GET['FilterField'][1]){
                         addFilter(1, 'and', 15, 'equal-to', 'No');
                         addFilter(2, 'and', 14, 'not-equal-to', 'UAT');
                         addFilter(3, 'and', 14, 'not-equal-to', 'Completed');
                }
.. but when using the SPM (by enabling the $options->FilterPage = 'hooks/Packages_filter.php'; line) the columnnumbers (15 and 14) hits wrong columns, and the not-equal-to comparison operator is changed to like.

How should I alter my default filter (and sorting) to work with SPM?

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: SPM and default filters

Post by a.gneady » 2018-10-11 14:01

When using SPM filters, addFilters won't work correctly unless you use indices that are not being used by SPM ... So, instead of using index 1, 2 and 3 in the above example, try 13, 14 and 15 (you should start the count with a number that matches 4n + 1, where n is any integer .. For example: 1, 5, 9, 13, 17, ... etc.)
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

SSchimkat
Veteran Member
Posts: 31
Joined: 2018-01-04 18:49

Re: SPM and default filters

Post by SSchimkat » 2018-12-04 10:58

ahh .. thanks .. using higher index´s did the trick. :-)

Thanks mate

Post Reply