• I’m trying to use Jquery-UI in an admin page in my plugin, and I’m getting this error when I try to use a jquery-ui function:
    jQuery(“ul”).sortable is not a function
    Here is how I’m loading the scripts:

    function list_ads_scripts() {
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-dropable');
        wp_enqueue_script('jquery-ui-dragable');
        wp_enqueue_script('jquery-ui-selectable');
        wp_register_script('list_ads', WP_PLUGIN_URL.'/ad_manager/js/list_ads.js', array('jquery', 'jquery-ui-core'));
        wp_enqueue_script('list_ads');
        }

    And here is my javascript file (list_ads.js):

    jQuery.noConflict();
    jQuery(document).ready(function(){
      alert('test');
      jQuery('ul').sortable();
    });

    The alert appears succesfuly, I just get the error with the sortable function.

Viewing 1 replies (of 1 total)
  • Hi,

    Seems to me that the required jQuery component is not loaded.

    Have you tried to use the following line?

    wp_enqueue_script( 'jquery-ui-sortable' );

    Good luck,
    Gabriel

Viewing 1 replies (of 1 total)
  • The topic ‘Jquery-ui in my plugin – jQuery("ul").sortable is not a function’ is closed to new replies.