[wp-hackers] jQuery UI Sortable in widget admin interface

Nathaniel Taintor goldenapplesdesign at gmail.com
Fri Apr 20 21:59:38 UTC 2012


Hi Jeremy,

It sounds like you don't have jquery-ui-sortable properly enqueued. (The
jquery-ui in wordpress only includes jQuery UI-core; you have to also
explicitly add jQuery-UI-sortable).

Something like this should work, if your theme scripts are in
my-theme-javascript.js:

wp_enqueue_script( 'my-sortable-script',
                            get_stylesheet_directory_uri() .
'/my-theme-javascript.js',
                            array( "jquery", "jquery-ui-core",
"jquery-ui-sortable" ) );


Hope that helps?


Nathaniel Taintor, Designer/Developer
*Golden Apples Design*
http://goldenapplesdesign.com

@GoldenApples | 717.434.3226
goldenapplesdesign at gmail.com



On Fri, Apr 20, 2012 at 2:39 PM, Jeremy Hough <jeremy at digitalbrands.com>wrote:

> Hi all,
>
> I am extending a custom widget to provide a sortable list of authors. I'm
> finding the list does not let me sort it...
>
> I am able to generate the markup easily enough. I have ensured the trigger
> for the sortable method is set to run on document.ready and after
> dependencies (jquery & jquery-ui) have been loaded.
>
> To top that off, code I put in jquery-ui event handlers executes, and no
> errors are recorded in firefox's error_console.
>
> I've tested the same code in a JS fiddle ( http://jsfiddle.net/Mn3sv/ ),
> and it works without any issues (as it should).
>
> Is there anything that would interfere with the dragging behavior for a
> sortable in the widget page in the WP admin interface?
>
> Instead of dragging to sort the LI items, the text simply gets selected
> instead. For something so simple, it is giving me a lot of trouble to get
> working.
>
> Thanks for any help!
>
> -Jeremy Hough
> ______________________________**_________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.**com <wp-hackers at lists.automattic.com>
> http://lists.automattic.com/**mailman/listinfo/wp-hackers<http://lists.automattic.com/mailman/listinfo/wp-hackers>
>


More information about the wp-hackers mailing list