Search Filter question

Discussions on developing plugins for the Cacti Plugin Architecture

Moderators: Moderators, Developers

Post Reply
Author
Message
smiles
Cacti User
Posts: 79
Joined: Mon Sep 10, 2012 5:54 pm

Search Filter question

#1 Post by smiles » Fri Jan 13, 2017 1:17 pm

I have written a plugin using syslog plugin by cigamit as a reference. It contains the javascript filter functions (for searching based on user text input), and also some additional filtering based on dropdown selections.

Both of the filters work independently, but when I try to use the cacti nav bar functionality (browsing record pages next and prev), I lose my dropdown filter criteria. How do I tie them together? The javascript filter and the built in cacti form submissions?

smiles
Cacti User
Posts: 79
Joined: Mon Sep 10, 2012 5:54 pm

Re: Search Filter question

#2 Post by smiles » Wed Feb 22, 2017 3:28 pm

Still haven't been able to figure out how to reliably pass the filter criteria between the php and javascript.

Any help would be appreciated.

smiles
Cacti User
Posts: 79
Joined: Mon Sep 10, 2012 5:54 pm

Re: Search Filter question

#3 Post by smiles » Wed Mar 08, 2017 10:55 am

Is there anyone on the Dev team that will consult (even if there are fees involved) on this issue?

User avatar
Osiris
Cacti Pro User
Posts: 835
Joined: Mon Jan 05, 2015 10:10 am

Re: Search Filter question

#4 Post by Osiris » Sat Mar 11, 2017 9:08 pm

Review cdef.php. there is a function filter_vars() that will remember previous settings. There are examples everywhere on how it works.
Before history, there was a paradise, now dust.

smiles
Cacti User
Posts: 79
Joined: Mon Sep 10, 2012 5:54 pm

Re: Search Filter question

#5 Post by smiles » Tue Apr 04, 2017 4:07 pm

Understanding the functions "api_plugin_hook_function" and "validate_store_request_vars" was the key. I have this all working now.

Thanks to cigamit for the write-up on Plugin Migration steps here https://github.com/Cacti/cacti/wiki/PluginMigration

Post Reply