Active
Project:
Ajax Load
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Jul 2012 at 13:19 UTC
Updated:
27 Aug 2012 at 03:48 UTC
Hi,
I want to show the node's edit form using ajax_load. Everything works great, except the ckeditor's rich editor...
My code to generate the form is:
function mymodule_ajax_navigate_form_callback() {
require_once(drupal_get_path('module', 'node') . '/node.pages.inc');
$nid = $_REQUEST['nid'];
$node = node_load($nid);
drupal_set_title(check_plain($node->title));
$form = drupal_get_form($node->type .'_node_form', $node);
$form = str_replace('action="/ajax-navigate-form', 'action="/node/'.$nid.'/edit', $form);
$result = array(
'content' => $form,
// Put the Javascript callback you will use here.
// You can if you wish leave out this line and instead
// call your callback directly in your Javascript. See
// comments in ajax_load_example.js.
'__callbacks' => array('Drupal.AjaxLoadNavigate.formCallback'),
);
// Call drupal_alter('ajax_data', ...). This is what allows ajax_load to
// add its data and register its Javascript callback.
// The second argument is the data to be altered.
// The third argument is a unique identifier for this AJAX data operation.
// The fourth and optional argument is the original data that was the subject
// of the ajax operation--in this case, a form ID.
drupal_alter('ajax_data', $result, 'ajax_load_example', 'ajax_load_example_form');
drupal_json($result);
}
Thanks for your help and sorry for my bad english...
Comments
Comment #1
twistedindustries commentedI am experiencing the same sort of issues and I have tried various wysiwyg editors both inside and outside the Wysiwyg module.
Using "console.log(response)" in the function "Drupal.AjaxLoad.loadComplete" seems to verify that all files are getting loaded but still the wysiwyg editor doesn't show up.