I have a module that uses a button to load an embed view everytime the button is clicked.
// function to print builder view
function workout_builder_template() {
$viewName = 'builder_view';
print views_embed_view($viewName);
}
workout_builder_template();
However after the button is pressed a new view is loaded and the view is no long ajaxified. For example, if I click the apply button after changing the exposed forms, the form submits to a new page. Before clicking the button that loads an embed view via ajax, the exposed form altered the view content via ajax.
Here is example html from the ajaxified view
<form accept-charset="UTF-8" id="views-exposed-form-builder-view-default" method="get" action="/drupal7/builder-view" class="ctools-auto-submit-full-form ctools-auto-submit-processed jquery-once-1-processed">
Here is example html from the ajax less view
<form accept-charset="UTF-8" id="views-exposed-form-builder-view-default" method="get" action="/drupal7/builder-view" class="ctools-auto-submit-full-form">
In the example the ajax less view does not have processed classes added to it. From this I suspect that the new view does not get javascript attached to it after the first ajax event. I have been researching drupal.behaviors and thought about printing
$vars['scripts'] = drupal_get_js();
print $vars['scripts'];
in the workout_builder_template() function displayed above, but I am not sure how this is done