Index: ui/ui.sortable.js =================================================================== --- ui/ui.sortable.js (revision 5268) +++ ui/ui.sortable.js (working copy) @@ -220,7 +220,10 @@ this.items = []; this.containers = [this]; var items = this.items; - var queries = [$(this.options.items, this.element)]; + + // itemQuery allows us to refine the selection of items used in the sortable. + var queries = typeof this.options.itemQuery == 'function' ? + this.options.itemQuery.apply(this) : [$(this.options.items, this.element)]; if(this.options.connectWith) { for (var i = this.options.connectWith.length - 1; i >= 0; i--){ Index: ui/demos/ui.sortable.html =================================================================== --- ui/demos/ui.sortable.html (revision 5268) +++ ui/demos/ui.sortable.html (working copy) @@ -91,6 +91,27 @@ +