0

バックグラウンドで UL をロードし、並べ替えのためにダイアログに表示する必要がありますが、JQuery/JQuery UI は初めてで、明らかに Google に問題があります。これは私が持っている限りです:

$(document).on('click','a.priority', function(){
    // Get the URL of the link
    var href = $(this).attr('href');
    // Tell the page to expect JS instead
    href = href + "/ajax";
    // Get the page content
    $.get(href, function(data){
        // Initialise a dialog for the content
        var my_dialog = $('<div></div>')
            .dialog({
                 autoOpen: false
                ,open: function (event, ui) {
                    // Add the result of the GET (a UL) as the dialog's content
                    my_dialog.html(data);
                    // Make it sortable, how?
                    my_dialog.sortable().disableSelection();
                    // Set the dialog title (this will be dynamic later, and we might need to call a single dialog that gets remangled rather than creating one every time)
                    my_dialog.dialog("option","title","Change priority");
                }
            });
        // Show the dialog
        wsd_dialog.dialog('open');
    });
    // Don't follow the link
    return false;
});

これにより、コンテンツ (並べ替えが必要なアイテムの UL) が取得され、ダイアログに表示されますが、UL は単一の「並べ替え可能な」要素として表示されます。

UL 自体ではなく、UL の LI 子をソート可能にするにはどうすればよいですか?

これはばかげた質問だと感じてください。ドキュメントに何かが欠けているに違いありません。

4

1 に答える 1