注册送现金一元秒提现

          <dfn id='s86t0'><optgroup id='s86t0'></optgroup></dfn><tfoot id='s86t0'><bdo id='s86t0'><div id='s86t0'></div><i id='s86t0'><dt id='s86t0'></dt></i></bdo></tfoot>

          <ul id='s86t0'></ul>

          • <small id='ytgzf'></small><noframes id='ytgzf'>

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

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

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

                  1. <li id='ytgzf'><abbr id='ytgzf'></abbr></li>
                  2. <small id='u6o3q'></small><noframes id='u6o3q'>

                  3. <tfoot id='u6o3q'></tfoot>

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

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

                        1. 当前位置:首页 > 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 聚友棋牌官网下载安装-首页 百胜棋牌---首页_欢迎您