hello, i have installed jquery.ui-1.6 and jquery_ui-6.x-1.x-dev.tar and i want build dialog from element of my page

javascript code

    $("#edit-field-name-0-value-wrapper").dialog();

give me error
TypeError: '$("#edit-field-name-0-value-wrapper").dialog' is not a function

i don't know js.
please, help me to understand how to fix it

Comments

ionmedia’s picture

ok, i found what where is no added all widgets by default and i must load needed via jquery_ui_add(array('ui.dialog', 'ui.draggable', 'ui.resizable'));

ok, i putt this into template.php and it's work, but how can i add js via jquery_ui_add to specified templates/nodes/pages ?

ionmedia’s picture

i found solution and maybe some people need it too

add to your .tpl file (page-node-add.tpl) this

jquery_ui_add(array('ui.dialog', 'ui.draggable', 'ui.resizable'));
$scripts = drupal_get_js();  
echo $scripts 

instead this

echo $scripts

ionmedia’s picture

and with http://drupal.org/node/388384#comment-3667740

jquery_ui_add(array('ui.dialog', 'ui.draggable', 'ui.resizable'));
$scripts = drupal_get_js();
$styles = drupal_get_css();
echo $styles;  
echo $scripts; 

for adding needed css and js from ui to tpl

mikedotexe’s picture

Thank you very much. I couldn't find a solution anywhere. It seemed so simple, but running a
$('#div').dialog(); wasn't accomplishing anything. Thank you for posting this.

prakhyatgailani’s picture

Issue summary: View changes

I guess applying

$("#dialog").dialog({
title: "jQuery Dialog Popup",
buttons: {
Close: function () {
$(this).dialog('close');
}
},
modal: true
});

might work

nod_’s picture

Status: Active » Closed (outdated)

Version for Drupal 6 is not supported anymore, closing.