注册送现金一元秒提现

    1. <form id='8v2vy'></form>
        <bdo id='8v2vy'><sup id='8v2vy'><div id='8v2vy'><bdo id='8v2vy'></bdo></div></sup></bdo>

            <small id='p37r8'></small><noframes id='p37r8'>

          • <tfoot id='p37r8'></tfoot>

              <legend id='p37r8'><style id='p37r8'><dir id='p37r8'><q id='p37r8'></q></dir></style></legend>
              <i id='p37r8'><tr id='p37r8'><dt id='p37r8'><q id='p37r8'><span id='p37r8'><b id='p37r8'><form id='p37r8'><ins id='p37r8'></ins><ul id='p37r8'></ul><sub id='p37r8'></sub></form><legend id='p37r8'></legend><bdo id='p37r8'><pre id='p37r8'><center id='p37r8'></center></pre></bdo></b><th id='p37r8'></th></span></q></dt></tr></i><div id='p37r8'><tfoot id='p37r8'></tfoot><dl id='p37r8'><fieldset id='p37r8'></fieldset></dl></div>

                  <bdo id='p37r8'></bdo><ul id='p37r8'></ul>

                1. <small id='4r2jw'></small><noframes id='4r2jw'>

                2. <tfoot id='4r2jw'></tfoot>

                    <legend id='4r2jw'><style id='4r2jw'><dir id='4r2jw'><q id='4r2jw'></q></dir></style></legend>
                    <i id='4r2jw'><tr id='4r2jw'><dt id='4r2jw'><q id='4r2jw'><span id='4r2jw'><b id='4r2jw'><form id='4r2jw'><ins id='4r2jw'></ins><ul id='4r2jw'></ul><sub id='4r2jw'></sub></form><legend id='4r2jw'></legend><bdo id='4r2jw'><pre id='4r2jw'><center id='4r2jw'></center></pre></bdo></b><th id='4r2jw'></th></span></q></dt></tr></i><div id='4r2jw'><tfoot id='4r2jw'></tfoot><dl id='4r2jw'><fieldset id='4r2jw'></fieldset></dl></div>

                        <bdo id='4r2jw'></bdo><ul id='4r2jw'></ul>

                        1. <li id='4r2jw'><abbr id='4r2jw'></abbr></li>
                        2. 当前位置:首页 > CMS教程 > Thinkphp > 列表

                          TP5实现表格拖动排序并保存到数据库的方法(附代码)

                          发布:smiling 来源: PHP粉丝网  添加日期:2019-02-05 13:21:51 浏览: 评论:0 

                          注册送现金一元秒提现BENPIANWENZHANGJIDAJIADAILAIDENEIRONGSHIGUANYUTP5SHIXIANBIAOGETUODONGPAIXUBINGBAOCUNDAOSHUJUKUDEFANGFA(FUDAIMA),YOUYIDINGDECANKAOJIAZHI,YOUXUYAODEPENGYOUKEYICANKAOYIXIA,XIWANGDUINIYOUSUOBANGZHU。

                          注册送现金一元秒提现QIANYIDUANSHIJIANXIUGAILEYIGEJIUDEXIANGMU,KEHUYAOQIUWOJIBIAOGEZHONGXINPAIXU,ANYISHENGDEZHICHENGPAIXU。YINWEIKEHUDEZHEIGEXIANGMUSHIYIYUANDERENSHIXITONG,KAOLVDAOZHENGGEYIYUANYOUJIQIANHAOREN,YAOSHIYIGEGEANKEHUDEYAOQIUPAIDELEIHUAIWODEXIAOYAO...XINGHAOZHEISHIWOXIANGQILEKEYILIYONGjqueryUiCHAJIANSHIXIANZHEIGEGONGNENG。DANSHIjqueryUiCHAJIANZHINENGZAIDANGQIANYEMIANSHANGPAIXU,YEMIANYISHUAXINYOUHUIFUYUANYANGLE。YUSHIWOJIUYANJIURUHETUODONGPAIXUBINGYONGJIUBAPAIXUBAOCUNDAOSHUJUKUZHONG,ZUOLE1XIAOSHI,ZUOCHULAILE。ZHEILIJILUYIXIA,RUGUOYOUTONGXUEYOUGENGHAODESILU,QINGBULINCIJIAO..

                          SHOUXIANXIAZAIjqueryUiCHAJIAN,WANGSHANGYISOUJIUYAO,ZHEILILVEGUO。

                          XIAZAIWANCHENGHOU,YINRUYEMIAN。JIARUYIXINGDAIMAJIUKEYI:

                          1. <script type="text/javascript" src="jquery-ui.js"></script> 
                          2.  
                          3. <script type="text/javascript"
                          4.  
                          5.   $(document).ready(function(){ 
                          6.  
                          7.     $("#sort tbody").sortable(); 
                          8.  
                          9. }); 
                          10.  
                          11. </script> 

                          注册送现金一元秒提现XUYAOZHUYIDESHI,XUANZEQIYINGGAIXUANZHONGBIAOGEDEtbody. sortFANGFAZHONGKEYITIANJIAHENDUOPEIZHIDECANSHU,JUTIDEKEYICHAKANZHEIKUANCHAJIANDEWENDANG。TONGYANGWANGSHANGYISOUYIDADUI,BIRUCAINIAOJIAOCHENGJIUYOU。XIANZAIZHISHISHIXIANLEZAIDANGQIANYEMIANPAIXU,DANSHUJUKUHAISHILAOYANGZI。XIAMIANSHIWODEBAPAIXUBAOCUNDAOSHUJUKUDEFANGFA。ZHIQIANWODEPAIXUSHIANZHAOSHUJUBIAODEIDZHI,MORENDAOXUDE,XIANZAIWOKEYIJISHUJUBIAOZHONGJIAYIGEsortZIDUAN,HUOZHEXXZIDUAN,DAIBIAOPAIXUDESHUZI。 ZAIMEICITUODONGWANCHENGHOU,LIYONGZHEIKUANCHAJIANNEIZHIDEupdateHANSHU,TONGGUOajaxFANGSHIBAPAIXUWANCHENGDEMEIGEXINGDEIDCHUANDAOHOUTAI。ZAIHOUTAIKONGZHIQILIJIESHOUHOU,BIANLI,BAPAIZAIDIYIXINGDESHUJUDEsortZHIGAIWEIJIANZHI+1.

                          注册送现金一元秒提现BIRUPAIXUWANCHENGHOUDIYIXINGDESHUJUIDZHIWEI8,DIERXINGDESHUJUIDWEI6,DISANXINGWEI2,HOUTAIJIESHOUBIANLISHI,IDWEI8DESHUJUKENDINGSHIDIYIGEBIANLIDE,NEIGAISHUJUZAIforeachLIMIANDEJIANZHIKENDINGSHI0,JI$kWEI0,NEIBATADEPAIXUGAIWEI$k+1JIWEI0+1DENGYU1.TONGLI,DIERGESHUJUDEsortJIUWEI$k+1JIWEI2,YICILEITUI.RANHOUANsortZHIZHENGXUPAILIEJIKE.

                          XIAMIANSHIQIANTAIDAIMA:

                          1. $("#sort tbody").sortable({ 
                          2.  
                          3.         update:function () { 
                          4.  
                          5.             var idArr = []; 
                          6.  
                          7.             $("input[name='id']").each(function () {//遍历每一行的ID值 
                          8.  
                          9.                 idArr.push($(this).val());//把拍完序的数据ID依次推入数组 
                          10.  
                          11.             }) 
                          12.  
                          13.             $.ajax({ 
                          14.  
                          15.                 type: "POST"
                          16.  
                          17.                 dataType: "json"
                          18.  
                          19.                 url: "__URL__/staff/pinyong"
                          20.  
                          21.                 data:{idArr:idArr}, 
                          22.  
                          23.                 success:function (data) { 
                          24.  
                          25.                     layer.msg(data['msg'],{icon:1,time:2000}); 
                          26.  
                          27.                 }, 
                          28.  
                          29.                 error:function (request) { 
                          30.  
                          31.                     console.log(request); 
                          32.  
                          33.                 } 
                          34.  
                          35.             }); 
                          36.  
                          37.         } 
                          38.  
                          39.     }); 

                          注册送现金一元秒提现ZHEIGESHIYIGELAOXIANGMU,TP3XIEDE,SUOYIWOMEIYONGTP5DEXIEFA,TP5ZHIXUYAOBAurlDIZHIGAIWEI{:url(...)}DEXIEFAJIUXING.

                          HOUTAIDAIMA:(YESHITP3DEXIEFA,TP5ZHIYAOYONGmodelFANGFAQUBIAOMOXING,RANHOUZAIGAIGAIsaveFANGFAJIUKEYI)

                          1. public function pinyong(){ 
                          2.  
                          3.  if (IS_POST) { 
                          4.  
                          5.       //前台post方式传数组的话,后台必须指定接收格式才能接收,否则会报错 
                          6.  
                          7.       $arr = I('idArr/a'); 
                          8.  
                          9.       foreach ($arr as $k => $v) { 
                          10.  
                          11.           M('pinyong')->where('id','eq',$v)->save(['sort'=>$k + 1]); 
                          12.  
                          13.       } 
                          14.  
                          15.       $this->success('排序成功'); 
                          16.  
                          17.   } else { 
                          18.  
                          19.       $this->display(); 
                          20.  
                          21.   } 

                          注册送现金一元秒提现ZHEIYANG,MEICIQIANTAITUODONGPAIXUDOUHUICHUFAupdateHANSHU,RANHOUJIUHUIBAXINPAIXUDEIDZHIYONGajaxCHUANDAOHOUTAI,HOUTAIJIESHOUHOU,ANSHUNXUZHONGXINXIUGAIsortZHIJIUKEYI.

                          Tags: TP5表格拖动排序

                          分享到:

                          靠谱的棋牌---首页_Welcome 蓝洞棋牌官网送3金币---首页_Welcome 百灵拼三张-Welcome 聚友棋牌官网下载安装-首页 百胜棋牌---首页_欢迎您