2 edited body
source | link

I have a site with a map and a grid in the same page and they both have exposed filters enabled, yet I only have the exposed filter of the grid visible at the page. When the grid view is not using ajax, when the page refreshes all works well, yet I would like to use ajax to update the map and the grid with filtered results at the same time to improve the user experience.

Things that I have tried and that I have already discarded: - Views Global Filter: I've tried this approach but it is kind of a mess since I have many fields to filter and sort with, and custom search preferences that I store in a session preferences key. And when I used it i had the impression that it was not possible to use with sorting preferences. - views_embed_view: I've read that this may be the solution in some posts, but I don't understand yet what this call does and my site has a complex layout and I just cannot embed one view after another. - Other stuff in a custom exposed filters submit function.

Ideally the solution would be to call an ajax refresh function from the custom submit function or to trigger it with javascript, when the update of the grid is triggered, it would be simple since the grid and the amp use the same arguments.

What I have thought thatwhat could be a hacky solution is to add the second exposed filter, to hide it with display:none, and then fill it with javascript and trigger the submit event whenever the visible filter of the grid is triggered. Nevertheless, if someone with proper expertise in Drupal can give me hint of how this should be properly accomplished it would be great!

I have a site with a map and a grid in the same page and they both have exposed filters enabled, yet I only have the exposed filter of the grid visible at the page. When the grid view is not using ajax, when the page refreshes all works well, yet I would like to use ajax to update the map and the grid with filtered results at the same time to improve the user experience.

Things that I have tried and that I have already discarded: - Views Global Filter: I've tried this approach but it is kind of a mess since I have many fields to filter and sort with, and custom search preferences that I store in a session preferences key. And when I used it i had the impression that it was not possible to use with sorting preferences. - views_embed_view: I've read that this may be the solution in some posts, but I don't understand yet what this call does and my site has a complex layout and I just cannot embed one view after another. - Other stuff in a custom exposed filters submit function.

Ideally the solution would be to call an ajax refresh function from the custom submit function or to trigger it with javascript, when the update of the grid is triggered, it would be simple since the grid and the amp use the same arguments.

What I have thought that could be a hacky solution is to add the second exposed filter, to hide it with display:none, and then fill it with javascript and trigger the submit event whenever the visible filter of the grid is triggered. Nevertheless, if someone with proper expertise in Drupal can give me hint of how this should be properly accomplished it would be great!

I have a site with a map and a grid in the same page and they both have exposed filters enabled, yet I only have the exposed filter of the grid visible at the page. When the grid view is not using ajax, when the page refreshes all works well, yet I would like to use ajax to update the map and the grid with filtered results at the same time to improve the user experience.

Things that I have tried and that I have already discarded: - Views Global Filter: I've tried this approach but it is kind of a mess since I have many fields to filter and sort with, and custom search preferences that I store in a session preferences key. And when I used it i had the impression that it was not possible to use with sorting preferences. - views_embed_view: I've read that this may be the solution in some posts, but I don't understand yet what this call does and my site has a complex layout and I just cannot embed one view after another. - Other stuff in a custom exposed filters submit function.

Ideally the solution would be to call an ajax refresh function from the custom submit function or to trigger it with javascript, when the update of the grid is triggered, it would be simple since the grid and the amp use the same arguments.

What I have thought what could be a hacky solution is to add the second exposed filter, to hide it with display:none, and then fill it with javascript and trigger the submit event whenever the visible filter of the grid is triggered. Nevertheless, if someone with proper expertise in Drupal can give me hint of how this should be properly accomplished it would be great!

    Tweeted twitter.com/#!/StackDrupal/status/468878153679908864
1
source | link

Refresh two views with same exposed filter using ajax

I have a site with a map and a grid in the same page and they both have exposed filters enabled, yet I only have the exposed filter of the grid visible at the page. When the grid view is not using ajax, when the page refreshes all works well, yet I would like to use ajax to update the map and the grid with filtered results at the same time to improve the user experience.

Things that I have tried and that I have already discarded: - Views Global Filter: I've tried this approach but it is kind of a mess since I have many fields to filter and sort with, and custom search preferences that I store in a session preferences key. And when I used it i had the impression that it was not possible to use with sorting preferences. - views_embed_view: I've read that this may be the solution in some posts, but I don't understand yet what this call does and my site has a complex layout and I just cannot embed one view after another. - Other stuff in a custom exposed filters submit function.

Ideally the solution would be to call an ajax refresh function from the custom submit function or to trigger it with javascript, when the update of the grid is triggered, it would be simple since the grid and the amp use the same arguments.

What I have thought that could be a hacky solution is to add the second exposed filter, to hide it with display:none, and then fill it with javascript and trigger the submit event whenever the visible filter of the grid is triggered. Nevertheless, if someone with proper expertise in Drupal can give me hint of how this should be properly accomplished it would be great!