最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

layui 對table中的數(shù)據(jù)進(jìn)行轉(zhuǎn)義的實(shí)例

 更新時間:2019年09月12日 12:02:37   作者:kerw1nKwan  
今天小編就為大家分享一篇layui 對table中的數(shù)據(jù)進(jìn)行轉(zhuǎn)義的實(shí)例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

方法一 通過done回調(diào)進(jìn)行遍歷:

//方法級渲染
    table.render({
      id: 'demoList',
      elem: '#demoList'
      , url: 'showDemoList'
      , cols: [[
        {checkbox: true, fixed: true, width: '10%'}
        , {field: 'id', title: '編號', width: '15%', sort: true}
        , {field: 'pipe_id', title: '機(jī)構(gòu)ID', width: '15%'}
        , {field: 'bank_id', title: '銀行ID', width: '10%'}
        , {field: 'pipe_cost', title: '成本', width: '10%'}
        , {field: 'status', title: '狀態(tài)', width: '20%'}
        , {field: 'remark', title: '操作', width: '20%', toolbar: '#toolBar'}
      ]],
      done: function (res, curr, count) {
        //如果是異步請求數(shù)據(jù)方式,res即為你接口返回的信息。
        //如果是直接賦值的方式,res即為:{data: [], count: 99} data為當(dāng)前頁數(shù)據(jù)、count為數(shù)據(jù)總長度
        $("[data-field='status']").children().each(function () {
          if ($(this).text() == '0') {
            $(this).text('有效');
          } else if ($(this).text() == '1') {
            $(this).text('無效');
          }
        });
      }
      , page: true
      , height: 'full-83'
    });

方法二 通過layui的templet模板實(shí)現(xiàn):

 , {field: 'status', title: '狀態(tài)', width: '20%',templet:'#status'}
 
<script type="text/html" id="status">
  {{# if(d.status=='0'){ }}
  有效
  {{# }else{ }}
    無效
  {{# } }}
</script>

以上這篇layui 對table中的數(shù)據(jù)進(jìn)行轉(zhuǎn)義的實(shí)例就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論

云阳县| 和政县| 柘城县| 巩留县| 界首市| 长乐市| 绥宁县| 新建县| 平阳县| 平湖市| 旅游| 巴林左旗| 曲水县| 高要市| 全州县| 宁远县| 东乡县| 博客| 阿瓦提县| 天柱县| 黄石市| 洪泽县| 关岭| 太和县| 外汇| 始兴县| 吉木萨尔县| 千阳县| 鹿邑县| 毕节市| 柳林县| 金溪县| 蕉岭县| 古浪县| 鄂伦春自治旗| 高雄市| 梨树县| 黔江区| 林芝县| 顺平县| 漳平市|