<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                小插件 ``` /** * @preserve https://gitee.com/chenjerome/bootstrap-table-merge-cells * * Version 1.0 * * Copyright (c) 2018-2018 chenjj * * Licensed under the MIT License **/ (function ($) { $.fn.mergeCells = function (fields) { var options = $(this).bootstrapTable('getOptions'); if (options.cardView) { return false; } var data = $(this).bootstrapTable('getData', true); if (fields.length == 0 || data.length == 0) { return false; } for(var i = 0, len = fields.length; i < len; i++){ merge(fields, this); fields.pop(); } function merge(fields,target) { //聲明一個map計算相同屬性值在data對象出現的次數和 var sortMap = {}; for(var i = 0; i < data.length; i++){ var key = ""; for (var f = 0; f < fields.length; f++) { key = key + "#" + data[i][fields[f]]; } if(sortMap.hasOwnProperty(key)){ sortMap[key] = sortMap[key] * 1 + 1; } else { sortMap[key] = 1; } } var index = 0; var fieldName = fields[fields.length - 1]; for(var prop in sortMap){ var count = sortMap[prop] * 1; $(target).bootstrapTable('mergeCells',{index:index, field:fieldName, colspan: 1, rowspan: count}); index += count; } } } })(jQuery); ``` 1. 在bootstraptable的數據加載完成后,即loadSuccess方法調用 ~~~ $('#'+table.id).on('load-success.bs.table', function (data) { var cellFileds = new Array("room","office"); $('#'+table.id).mergeCells(cellFileds); }); ~~~ 其中cellFileds 就是需要合并的單元格的列名,這里的"room"是"小區名稱","office"是"省市區" 使用前 ![](https://img.kancloud.cn/28/78/28780e05acda02b926b259f143a399bd_351x291.png) 使用后 ![](https://img.kancloud.cn/da/5b/da5bfbb32908654817437df62b14eaad_351x289.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看