Filter before

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
pasbonte
Veteran Member
Posts: 162
Joined: 2013-02-06 09:49

Filter before

Post by pasbonte » 2014-06-23 19:13

hello
how to filter a table before it is displayed?
being French, I can not begin to understand.
I have a code_structure field.
this field is blank with some recordings.
how to filter to display only non-empty?

pasbonte
Veteran Member
Posts: 162
Joined: 2013-02-06 09:49

Re: Filter before

Post by pasbonte » 2014-06-28 19:47

no response ?
merci !

pasbonte
Veteran Member
Posts: 162
Joined: 2013-02-06 09:49

Re: Filter before

Post by pasbonte » 2014-06-29 09:39

help !
please :D

wplim
Veteran Member
Posts: 36
Joined: 2013-01-17 22:42

Re: Filter before

Post by wplim » 2014-06-30 00:37

Hi pasbonte,

Have you look into this tutorial:
http://bigprof.com/appgini/tips-and-tut ... ult-filter

Your code in the hook folder yourtablename.php should look something like below:

Code: Select all

function yourtablename_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 yourtablename
			table where the value of the code_structure field (assuming is the 7th field) field is not empty.
		*/
		addFilter(1, 'and', 7, 'isNotEmpty', '');
	}
	
	return TRUE;
}
**replace yourtablename with the actual table name.

faariwasi
Posts: 1
Joined: 2014-11-21 09:47

Re: Filter before

Post by faariwasi » 2014-11-21 09:50

Thank you very much. This works great!

Post Reply