1. NOTICE: If you are using Fabrik and update to Joomla 3.10, you will need to update to Fabrik 3.10. And, if you are using Fabrik, do not upgrade to Joomla 4, we do not have a supported version ready for release. More information on a release date coming soon. Also, please note that Fabrik 3.10 will not install on any Joomla sites less than 3.8.
    Dismiss Notice

List PHP events - hide some rows, custom filter

Discussion in 'Community' started by urbido, Jul 26, 2022.

  1. urbido

    urbido Member

    Level: Community
    Hi, I have custom input in filters, which I pass on change in filter array. Then in PHP events (onLoadData) I take that custom input, process some data and change some rows. It works fine, but I would like to "hide/delete unchanged rows". I tried to do in in onPreLoadData, but anytime I do $model->someMethod, I get 500 error. Also, I tried in "onLoadData", in foreach($rows as $row) unset $row, set $row = null, but its still visible in list.

    What is proper way to take list filter params, do some custom-functions and then remove certain rows from list data, according to input filter params and custom-function's result?
  2. lousyfool

    lousyfool Well-Known Member

    Level: Community
    In both onPreLoadData and onLoadData code such as in the Wiki examples should work.
    Which PHP version are you running?
    Don't you get detailed info for the 500 error with error reporting and debug on?
    Don't forget, you can always var_dump() or print_r() variables followed by an "exit;" in your code to see what you're having.
    Double-/triple-check for syntax errors, of course.

    Guess more can't be said without knowing your exact code.
  3. urbido

    urbido Member

    Level: Community
    You didn't get me. I tried several ways to hide rows. Is there any way to hide/remove rows from list using php_events?

Share This Page