Refresh view from block module via ajax (no exposed filter)

Hi there.
I'm working on an module which povides a form in a block to edit the filter settings of a view. I'm not using an exposed filter, because the form is updating itself via AHAH - selecting one or more categories in a multi select form populates another multi select box with items - and I don't know, if this would be possible with 'hook_form_alter()'.

Now, I update the filter for taxonomy terms (and later some other filter sets) in my view object. After that I wish to update the view without page reloading. But I can't find any function to call in views API which manages the view refreshing. I found the 'ajax_views.js' file but no code example to use it. Is there a simple way using the build in functionalities of views or would it be simpler to use the result of '$view->preview()' with my own AJAX code (e.g. update the content of a wrapper div)?

Regards,
pronce

Login to post comments

Trying to do the same thing you described in the first half

pimousse98 - Tue, 2009-11-03 17:40

Hi pronce,

I am trying to build a simplified views exposed filters form, where a drop down of fields to filter by would, on select, cause the appropriate form input fields to appear - so, building the form dynamically (I am considering maybe just generating a giant form, hiding the unused fields and showing them when the user selects the parameter in the drop-down). Have you succeeded in building the form that updates itself?
Any input would be greatly appreciated.
Thanks,

Delphine
ps. the AJAX updating of the view would be great too...