When clicking an element I get a form which is generated by a view (using https://www.drupal.org/project/editablefields module). The problem is that the ajax functionality of the form is lost (no ajax-processed classes are present). This is the working js code to retrieve the view:
(function($,Drupal) {
Drupal.behaviors.MODULE = {
attach:function (context, settings) {
$('#test').click(function () {
var args = (1, 2, 3);
$.ajax({
url: Drupal.settings.basePath + 'views/ajax',
type: 'post',
data: {
view_name: 'test_view',
view_display_id: 'block',
view_args: args,
},
dataType: 'json',
success: function (response) {
if (response[1] !== undefined) {
var viewHtml = response[1].data;
$('#form_test').html(viewHtml);
Drupal.attachBehaviors();
}
}
});
});
}
}
}(jQuery, Drupal));
So my question is how to get ajax working again on the form? Do I have to call ajax_pre_render_element
and if so in which PHP function?