I am trying to filter out the no results items in my exposed filters. (I know i can use selective filters, but in this case i can't use them).

So i alter the filters with form_alter, check which options that hasn't got any results and unset those options.

It work's on first page load, but when my view is updated with ajax, the form alter isn't called. This only happens when the exposed filters are displayed as block. If the filters are inside the view, the form alter is called every time the view is updated by ajax.

Any suggestions to fix this? Add a class and work with a custom drupal behaviour javascript function to update this block?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.