I want to use ui.draggable in my module.
Im using drupal_ad_js() to add ui libraries. And it gives js errors.
But i dont think that its right. How to add ui libraries?

drupal_add_js('misc/ui/jquery.ui.core.min.js', array('weight' => 5));
drupal_add_js('misc/ui/jquery.ui.widget.min.js', array('weight' => 6));
drupal_add_js('misc/ui/jquery.ui.draggable.min.js', array('weight' => 7));
drupal_add_js('misc/ui/jquery.ui.droppable.min.js', array('weight' => 8));

Comments

scw’s picture

somehow like that, i mean like that.

 $build['elem'] = array();
 $build['elem']['#attached']['library'][] = array('system', 'ui.draggable');
 $build['elem']['#attached']['js'][] = array('data' => '(function($){$(function() {
         ...
 })})(jQuery);', 'type' => 'inline');

cheers... MC ;-)

basil.shine’s picture

Thank you.

You gave me good idea.
And i used this code.

drupal_add_library('system', 'ui.draggable');