Applying Default Table Filters Problem

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
TheNoLifer
Veteran Member
Posts: 67
Joined: 2015-06-06 12:10

Applying Default Table Filters Problem

Post by TheNoLifer » 2016-06-03 19:58

Hi All,

Having an issue implementing Default Filters on a table, wondering if someone who has done it could look over my process and see if they could spot any issues?

Following tutorial here - http://bigprof.com/appgini/tips-and-tut ... ult-filter

The column I wish to filter on is column number 28 in my table;
1.JPG
1.JPG (21.97 KiB) Viewed 3090 times
It's a lookup column to another table - so while the text displays "RESTRICT" in the front-end, the database value for the row I'm using to test has the integer 4 in this column.

I've edited the hook for my table name;

Code: Select all

function ContentItem_init(&$options, $memberInfo, &$args){

	/* Apply a default filter only if no filter is already applied by the user */
	if(!$_POST['FilterField'][1] && !$_GET['FilterField'][1]){
		/*
			In the call below, we want to display records of the ContentItem
			table where the value of the 28th field - mark for review - is not equal to '4' which is a lookup to the RESTRICT value.
		*/
		addFilter(1, 'and', 28, 'not-equal-to', 4);
	}

		return TRUE;
	}
So, according to the tutorial, 1 is the first filter, and, to append this filter to any others, 28, being the 28th column in the table, 'not-equal-to' - I don't want to show any records with a value of 4 (or RESTRICT) - and lastly 4 - the int value in the column. I initially tried using the text "RESTRICT" as it appears in the front end, but that surely won't work, as this is a lookup field. So I tried '4' (treated as varchar with single quotes) and 4 without quotes, but it's not doing anything to my results.

Any ideas?

Thanks!

Post Reply