Sub-table filter

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
mekin
Veteran Member
Posts: 40
Joined: 2019-04-22 17:09

Sub-table filter

Post by mekin » 2019-07-01 09:33

Hello,

is it possible to add a filter to the records that are shown as child-records in the sub-table view?

Example, a location has many objects.
But if an object is not working, this object's status-field will be changed to "OUT OF ORDER".
So I just want to show al objects in the sub-table at the bottom of the Location's detailview that are "WORKING".

mekin
Veteran Member
Posts: 40
Joined: 2019-04-22 17:09

Re: Sub-table filter

Post by mekin » 2019-07-01 10:29

I got the right php-file, parent-children.php, but there is no hook-file for this one.
I'm testing some changes in the query it is running from this php-file...

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Sub-table filter

Post by onoehring » 2019-07-01 13:50

Hi,

maybe you can use this approach:
Use php and a hook to check if the object is working. If yes - everything is fine.
If now, you probably find yourself at the same problem I found myself ( viewtopic.php?f=2&t=3104&p=10381#p10381 ) i.e. the sub-table is not rendered at the beginning, but by ajax "later".
Take a look at the post I linked to. Using an idea from jsetzer ( viewtopic.php?f=2&t=3104&p=10381#p10375 ), I was able to create a function that checks - using a timer - every 1 second. You could also do this, and if some variable you set after your object check (working/out of order) you can manipulate the output in the sub-table.

Just a suggestion.

Oh, did you mean you want to check in the subtable if there is something working?
Maybe create a view in your database and use that as subtable?
Also you might use my suggestion and use jquery to check the column in the subtable for working/not working. If working - fine, if not, hide that line from view like this maybe:
In the hook for your table, function ...._footer:

Code: Select all

if ($memberInfo['group'] != 'Admins' ) {				
$FuerMitarbeiter = "<script>\$j('#ID_ContainerBauform-container').closest('.form-group').hide()</script>";					
		}
$footer= $FuerMitarbeiter . '<%%FOOTER%%>';			
			break;
Let me explain:
If the logged in user is not in the admins group, he will not see the #ID_ContainerBauform-container (in the main table though). You might be able to adjust/rework that code for your needs.

Olaf

Post Reply