jQuery Connected Sortable Lists, Save Order to MySQL

后端 未结 1 701
一整个雨季
一整个雨季 2020-12-29 00:01

Hoping that using something like this demo it is possible to drag items within and between two columns, and update their order either live or with a \"save\" button to MySQL

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-29 00:11

    what I would do is split them up

       data    :
        {
          sort1:$('#sortable1').sortable('serialize'),
          sort2:$('#sortable2').sortable('serialize')
        }
    

    then when you post you can get the request and set them as needed, I hope that makes sense

    so what I do is this

    parse_str($_REQUEST['sort1'],$sort1); 
    
    foreach($sort1 as $key=>$value){
        //do sutff;
    }
    

    0 讨论(0)
提交回复
热议问题