I'm trying to reload a views block that needs an argument. I'm able to load blocks using

$.get(base_url + '?q=component/block/' + module_name + '/' + block_id, null, function(newHtml) 

but it will only returns blocks that don't require an argument (nid). So I'm trying to use component/view instead thinking maybe this is the better way to reload a view.

Unfortunately, I get the error

warning: Missing argument 2 for component_get_view() in /sites/all/modules/component/component.module on line 81.

when trying to use component/view as the url. How are other people able to do this? Also, I don't see how to pass in the view name and display name to components. How are we supposed to do this?

Comments

cerup’s picture

Title: component_get_view() Missing argument 2 ? » How do you reload a view that requires an argument?

Ok, it looks like maybe I wasn't providing the full URL. I've changed it to...

$.get(base_url + '?q=component/view/' + view_name + '/' + display_id + '/' + nid, null, function(newHtml) {			

If I manually put in a 'nid', then it returns the right view. Is there a way to pass the nid or another argument to component dynamically? How does one refresh a view that requires an argument to load? Shouldn't the views_embed_view be able to get the arguments automatically when it's called?

rlnorthcutt’s picture

Issue summary: View changes
Status: Active » Closed (outdated)