Hi,
Wysiwyg works fine for the node forms when called as node/add/.
When I called it using drupal_render(node_add()); in ajax callback, form gets loaded,however, editor is not loaded.
Please help me.

Comments

twod’s picture

Status: Active » Postponed (maintainer needs more info)

Are there any errors in the browser's JavaScript console when performing the AJAX-triggering actions?

Are you doing anything else in the AJAX callback other than calling drupal_render(node_add());?
How is the callback initiated? Are you using the Form API #ajax property?

Are you sure you need to call drupal_render()?
Please see the #unrendered API change and the #menu_callback_array API change.

mehtatejas’s picture

I was running this code by getJSON method. Hence wysiwyg js is not getting attached even with attachbehaviours.
With 'use-ajax' in drupal link works fine.

twod’s picture

Hmm, I'm not sure I understand what you mean.
Could you post or link to the code you are using so I can try on my development server?

smartango’s picture

mehtatejas, me too, I don't understand, I use this field definition:

$myform['description'] = array(
                                '#type'=>'text_format',
                                '#default_value' => isset($item['description'])?$item['description']:'',
                                '#title'=> t('description'),
                                '#prefix' => '<div class="clearfix">',
                                '#suffix' => '</div>',
                        );

where do I add 'use-ajax' ?

is someway related to http://drupal.org/node/356480

twod’s picture

If you apply the patch from #1391034: wysiwyg is not loaded when used with node_add() in ajax forms, you'll also need the D7 Core patch from #1287368: Drupal.settings.ajaxPageState.css gets overwritten (unless it's already made it into 7.x-dev by the time you read this). That might fix things, but I can't guarantee it since I don't have the whole callback code or know how it's requested.

twod’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Without further details about the problem I can only close this issue. Please re-open it if you can provide the requested information.