Hi,
I have a view that have a page and a block,
the only difference between them is the format.
the view uses an exposed filter which identical for both and is uses ajax to get the data

I am trying to build a page that will hold both the page and the block, and will have an exposed filter that will affect both the page and the block.

if I was not using the ajax it would be simple, the ajax makes things much more complicated.

Any thoughts?
Avner

Comments

dawehner’s picture

Component: search data » exposed filters
Priority: Major » Normal

You would certainly have to use some custom javascript. Recently we refactored views/js/ajax_view.js so this would be probably much easier then before, but i can't give you a 100% instruction how to do it.

In general i would trigger the ajax request from the other view with the same data as the view with the exposed form.

avner’s picture

thats exactly what i am trying to do,
however i cant seem to get it done
for one the .submit() function will not trigger upon submission of the first form
if i use the click(). function it will work only once,
it seems that the click function is not binded to the form after first ajax is performed
below is the code i use, any thoughts?

Drupal.behaviors.twoForms = {
  attach: function(context, settings) {
    jQuery('#views-exposed-form-form1:not(.views-exposed-form-form1-processed)', context)
      .addClass('views-exposed-form-form1-processed')
       .find('.form-submit').click(
         function() {
	   jQuery('#views-exposed-form-form1', context).find('SELECT, INPUT').each(function (i){
	     var name = jQuery(this).attr('name');
	     var val = jQuery(this).val();
	     jQuery('#views-exposed-form-form2 [name="' + name + '"]', context).val(val);
						
	});
	jQuery('#views-exposed-form-form2 .form-submit', context).trigger("click");
      }
    );
  }
}

?>

avner’s picture

i eventually built this page by using an iframe in the block and changing the iframe's url to change the filtering options.
in my opinion this is an ugly solution but it works

kars-t’s picture

Status: Active » Fixed

Hi

I am closing this issue to clean up the issue queue. Feel free to reopen the issue if there is new information and the problem still resides. If not please make sure you close your issues that you don't need any more.

Maybe you can get support from the local user group. Please take a look at this list at groups.drupal.org.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.