1. "Fabrik 4" helpers needed!

    You are invited to join other community members active in coding, maintaining and improving Fabrik. Please visit https://fabrik.help for more information!
    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 Staff 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