开发者

how to save sortable items in mvc

开发者 https://www.devze.com 2022-12-18 11:32 出处:网络
i have been working on my carousel items. i need to have a sortable list views in order for me to choose the appropriate format of details in the actual site.

i have been working on my carousel items. i need to have a sortable list views in order for me to choose the appropriate format of details in the actual site.

i was able to do the sortable items using this command in jquery

$(function() {
    $("#subsortsortable tbody.content").sortable();
    $("#subsortsortable tbody.content").disableSelection();

    $("tbody.subcontent").sortable();
    $(开发者_StackOverflow社区"tbody.subcontent").disableSelection();
});

then i added another jquery ui 1.7.1 in the site master: http://www.wil-linssen.com/musings/entry/extending-the-jquery-sortable-with-ajax-mysql/

i need to save the sorted items i dragged so when i click the refresh button. the new sorted items will be displayed

thanks in advance


Here is what i do and works fine for me, i have a hidden field that i throw the values as comma separated string. Example:

$('#refresh').click(function() {
     var items = $('#sortable').sortable('toArray');

     $('#sortablevalues').val(items);
});
0

精彩评论

暂无评论...
验证码 换一张
取 消