静态转数据表格 这个算BUG吗

讨论 未结
28 311
用个名字真难
悬赏:10飞吻
<table class="layui-table" lay-filter="list" width="100%" border="0" cellspacing="0" cellpadding="0"><thead><tr><td rowspan="2" lay-data="{field:'louceng', width:200}">楼层</td><td colspan="2">1单元</td><td colspan="2">2单元</td><td colspan="2">3单元</td></tr><tr><td lay-data="{field:'men10', width:80}">1门</td><td lay-data="{field:'men20', width:80}">2门</td><td lay-data="{field:'men11', width:80}">1门</td><td lay-data="{field:'men21', width:80}">2门</td><td lay-data="{field:'men12', width:80}">1门</td><td lay-data="{field:'men22', width:80}">2门</td></tr></thead><tbody><tr><td>13楼</td><td>1301</td><td>1302</td><td>1301</td><td>1302</td><td>1301</td><td>1302</td></tr><tr><td>12楼</td><td>1201</td><td>1202</td><td>1201</td><td>1202</td><td>1201</td><td>1202</td></tr><tr><td>11楼</td><td>1101</td><td>1102</td><td>1101</td><td>1102</td><td>1101</td><td>1102</td></tr><tr><td>10楼</td><td>1001</td><td>1002</td><td>1001</td><td>1002</td><td>1001</td><td>1002</td></tr><tr><td>9楼</td><td>901</td><td>902</td><td>901</td><td>902</td><td>901</td><td>902</td></tr><tr><td>8楼</td><td>801</td><td>802</td><td>801</td><td>802</td><td>801</td><td>802</td></tr><tr><td>7楼</td><td>701</td><td>702</td><td>701</td><td>702</td><td>701</td><td>702</td></tr><tr><td>6楼</td><td>601</td><td>602</td><td>601</td><td>602</td><td>601</td><td>602</td></tr><tr><td>5楼</td><td>501</td><td>502</td><td>501</td><td>502</td><td>501</td><td>502</td></tr><tr><td>4楼</td><td>401</td><td>402</td><td>401</td><td>402</td><td>401</td><td>402</td></tr><tr><td>3楼</td><td>301</td><td>302</td><td>301</td><td>302</td><td>301</td><td>302</td></tr><tr><td>2楼</td><td>201</td><td>202</td><td>201</td><td>202</td><td>201</td><td>202</td></tr><tr><td>1楼</td><td>101</td><td>102</td><td>101</td><td>102</td><td>101</td><td>102</td></tr></tbody></table>
	layui.table.init('list', { //转化静态表格

});
回帖
  • 有重复数据 无法显示
    0 回复
  • 你能排个版吗?
    0 回复
  • @飞天神猪 [汗] 我这个生成出来的。。。
    0 回复
  •   <table class="layui-table hrcmstable" lay-filter="list" width="100%" border="0" cellspacing="0" cellpadding="0">
    <thead>
    <tr>
    <td rowspan="2" lay-data="{field:\'louceng\', width:200}">楼层</td>
    <td colspan="2">1单元</td>
    <td colspan="2">2单元</td>
    <td colspan="2">3单元</td>
    </tr>
    <tr>
    <td lay-data="{field:\'men10\', width:80}">1门</td>
    <td lay-data="{field:\'men20\', width:80}">2门</td>
    <td lay-data="{field:\'men11\', width:80}">1门</td>
    <td lay-data="{field:\'men21\', width:80}">2门</td>
    <td lay-data="{field:\'men12\', width:80}">1门</td>
    <td lay-data="{field:\'men22\', width:80}">2门</td>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td>13楼</td>
    <td>1301</td>
    <td>1302</td>
    <td>1301</td>
    <td>1302</td>
    <td>1301</td>
    <td>1302</td>
    </tr>
    <tr>
    <td>12楼</td>
    <td>1201</td>
    <td>1202</td>
    <td>1201</td>
    <td>1202</td>
    <td>1201</td>
    <td>1202</td>
    </tr>
    <tr>
    <td>11楼</td>
    <td>1101</td>
    <td>1102</td>
    <td>1101</td>
    <td>1102</td>
    <td>1101</td>
    <td>1102</td>
    </tr>
    <tr>
    <td>10楼</td>
    <td>1001</td>
    <td>1002</td>
    <td>1001</td>
    <td>1002</td>
    <td>1001</td>
    <td>1002</td>
    </tr>
    <tr>
    <td>9楼</td>
    <td>901</td>
    <td>902</td>
    <td>901</td>
    <td>902</td>
    <td>901</td>
    <td>902</td>
    </tr>
    <tr>
    <td>8楼</td>
    <td>801</td>
    <td>802</td>
    <td>801</td>
    <td>802</td>
    <td>801</td>
    <td>802</td>
    </tr>
    <tr>
    <td>7楼</td>
    <td>701</td>
    <td>702</td>
    <td>701</td>
    <td>702</td>
    <td>701</td>
    <td>702</td>
    </tr>
    <tr>
    <td>6楼</td>
    <td>601</td>
    <td>602</td>
    <td>601</td>
    <td>602</td>
    <td>601</td>
    <td>602</td>
    </tr>
    <tr>
    <td>5楼</td>
    <td>501</td>
    <td>502</td>
    <td>501</td>
    <td>502</td>
    <td>501</td>
    <td>502</td>
    </tr>
    <tr>
    <td>4楼</td>
    <td>401</td>
    <td>402</td>
    <td>401</td>
    <td>402</td>
    <td>401</td>
    <td>402</td>
    </tr>
    <tr>
    <td>3楼</td>
    <td>301</td>
    <td>302</td>
    <td>301</td>
    <td>302</td>
    <td>301</td>
    <td>302</td>
    </tr>
    <tr>
    <td>2楼</td>
    <td>201</td>
    <td>202</td>
    <td>201</td>
    <td>202</td>
    <td>201</td>
    <td>202</td>
    </tr>
    <tr>
    <td>1楼</td>
    <td>101</td>
    <td>102</td>
    <td>101</td>
    <td>102</td>
    <td>101</td>
    <td>102</td>
    </tr>
    </tbody>
    </table>
    0 回复
  • [挖鼻] 难道又要沉了么。。。
    0 回复
  • 0 回复
  • 效果是这样的吗?
    0 回复
  • @飞天神猪 对 转换成数据表格后边的有些不显示了
    0 回复
  • 不是都显示了吗?哪个没显示
    0 回复
  • @飞天神猪 你怎么写的??
    0 回复
  • 我就是把你的代码放到我这里运行出来的效果啊
    0 回复
  • @飞天神猪 [衰] 不能啊 我这新页面 什么都没加 怎么不行呢
    0 回复
  • 看看 你的js引入的对不对 模块有没有加载 啥的
    0 回复
  • @飞天神猪 我见鬼了。。还是一样 后边的不显示 就显示两列[衰]
    0 回复
  • 我感觉应该是你自己的问题。。。再找找原因吧
    0 回复
  • simpleno
    15天前
    layui.table.init('list', { //转化静态表格

    });
    你这个是直接引入的ALL js吗? 是不是用法问题引起的?
    0 回复
  • @simpleno 插件引入
    0 回复
  • simpleno
    15天前
    @用个名字真难 恩我知道是插件用法,我的意思是会不会是用法引起的?
    0 回复
  • Array(28)
    0
    :
    {louceng: "28楼", undefined: "2802", men10: "2801", men20: "2802", men11: undefined, …}
    1
    :
    {louceng: "27楼", undefined: "2702", men10: "2701", men20: "2702", men11: undefined, …}
    2
    :
    {louceng: "26楼", undefined: "2602", men10: "2601", men20: "2602", men11: undefined, …}
    3
    :
    {louceng: "25楼", undefined: "2502", men10: "2501", men20: "2502", men11: undefined, …}
    4
    :
    {louceng: "24楼", undefined: "2402", men10: "2401", men20: "2402", men11: undefined, …}
    5
    :
    {louceng: "23楼", undefined: "2302", men10: "2301", men20: "2302", men11: undefined, …}
    6
    :
    {louceng: "22楼", undefined: "2202", men10: "2201", men20: "2202", men11: undefined, …}
    7
    :
    {louceng: "21楼", undefined: "2102", men10: "2101", men20: "2102", men11: undefined, …}
    8
    :
    {louceng: "20楼", undefined: "2002", men10: "2001", men20: "2002", men11: undefined, …}
    9
    :
    {louceng: "19楼", undefined: "1902", men10: "1901", men20: "1902", men11: undefined, …}
    10
    :
    {louceng: "18楼", undefined: "1802", men10: "1801", men20: "1802", men11: undefined, …}
    11
    :
    {louceng: "17楼", undefined: "1702", men10: "1701", men20: "1702", men11: undefined, …}
    12
    :
    {louceng: "16楼", undefined: "1602", men10: "1601", men20: "1602", men11: undefined, …}
    13
    :
    {louceng: "15楼", undefined: "1502", men10: "1501", men20: "1502", men11: undefined, …}
    14
    :
    {louceng: "14楼", undefined: "1402", men10: "1401", men20: "1402", men11: undefined, …}
    15
    :
    {louceng: "13楼", undefined: "1302", men10: "1301", men20: "1302", men11: undefined, …}
    16
    :
    {louceng: "12楼", undefined: "1202", men10: "1201", men20: "1202", men11: undefined, …}
    17
    :
    {louceng: "11楼", undefined: "1102", men10: "1101", men20: "1102", men11: undefined, …}
    18
    :
    {louceng: "10楼", undefined: "1002", men10: "1001", men20: "1002", men11: undefined, …}
    19
    :
    {louceng: "9楼", undefined: "902", men10: "901", men20: "902", men11: undefined, …}
    20
    :
    {louceng: "8楼", undefined: "802", men10: "801", men20: "802", men11: undefined, …}
    21
    :
    {louceng: "7楼", undefined: "702", men10: "701", men20: "702", men11: undefined, …}
    22
    :
    {louceng: "6楼", undefined: "602", men10: "601", men20: "602", men11: undefined, …}
    23
    :
    {louceng: "5楼", undefined: "502", men10: "501", men20: "502", men11: undefined, …}
    24
    :
    {louceng: "4楼", undefined: "402", men10: "401", men20: "402", men11: undefined, …}
    25
    :
    {louceng: "3楼", undefined: "302", men10: "301", men20: "302", men11: undefined, …}
    26
    :
    {louceng: "2楼", undefined: "202", men10: "201", men20: "202", men11: undefined, …}
    27
    :
    {louceng: "1楼", undefined: "102", men10: "101", men20: "102", men11: undefined, …}
    @simpleno 我也懵逼呢。。。。。。。。

    渲染回调数据是
    0 回复
  • simpleno
    15天前
    @用个名字真难 undefined
    0 回复
  • @simpleno 是的 没找到原因
    0 回复
  • <html>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="http://res.layui.com/layui/dist/css/layui.css?t=1505105092499" media="all">
    <head></head>
    <body>
    <table class="layui-table" lay-filter="listset" width="100%" border="0" cellspacing="0" cellpadding="0">
    <thead>
    <tr>
    <td rowspan="2" lay-data="{field:'louceng', width:200}">楼层</td>
    <td colspan="2">1单元</td>
    <td colspan="2">2单元</td>
    </tr>
    <tr>
    <td lay-data="{field:'men1', width:80}">1门</td>
    <td lay-data="{field:'men2', width:80}">2门</td>
    <td lay-data="{field:'men3', width:80}">1门</td>
    <td lay-data="{field:'men4', width:80}">2门</td>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td>28楼</td>
    <td>2801</td>
    <td>2802</td>
    <td>2801</td>
    <td>2802</td>
    </tr>
    <tr>
    <td>27楼</td>
    <td>2701</td>
    <td>2702</td>
    <td>2701</td>
    <td>2702</td>
    </tr>
    <tr>
    <td>26楼</td>
    <td>2601</td>
    <td>2602</td>
    <td>2601</td>
    <td>2602</td>
    </tr>
    <tr>
    <td>25楼</td>
    <td>2501</td>
    <td>2502</td>
    <td>2501</td>
    <td>2502</td>
    </tr>
    <tr>
    <td>24楼</td>
    <td>2401</td>
    <td>2402</td>
    <td>2401</td>
    <td>2402</td>
    </tr>
    <tr>
    <td>23楼</td>
    <td>2301</td>
    <td>2302</td>
    <td>2301</td>
    <td>2302</td>
    </tr>
    <tr>
    <td>22楼</td>
    <td>2201</td>
    <td>2202</td>
    <td>2201</td>
    <td>2202</td>
    </tr>
    <tr>
    <td>21楼</td>
    <td>2101</td>
    <td>2102</td>
    <td>2101</td>
    <td>2102</td>
    </tr>
    <tr>
    <td>20楼</td>
    <td>2001</td>
    <td>2002</td>
    <td>2001</td>
    <td>2002</td>
    </tr>
    <tr>
    <td>19楼</td>
    <td>1901</td>
    <td>1902</td>
    <td>1901</td>
    <td>1902</td>
    </tr>
    <tr>
    <td>18楼</td>
    <td>1801</td>
    <td>1802</td>
    <td>1801</td>
    <td>1802</td>
    </tr>
    <tr>
    <td>17楼</td>
    <td>1701</td>
    <td>1702</td>
    <td>1701</td>
    <td>1702</td>
    </tr>
    <tr>
    <td>16楼</td>
    <td>1601</td>
    <td>1602</td>
    <td>1601</td>
    <td>1602</td>
    </tr>
    <tr>
    <td>15楼</td>
    <td>1501</td>
    <td>1502</td>
    <td>1501</td>
    <td>1502</td>
    </tr>
    <tr>
    <td>14楼</td>
    <td>1401</td>
    <td>1402</td>
    <td>1401</td>
    <td>1402</td>
    </tr>
    <tr>
    <td>13楼</td>
    <td>1301</td>
    <td>1302</td>
    <td>1301</td>
    <td>1302</td>
    </tr>
    <tr>
    <td>12楼</td>
    <td>1201</td>
    <td>1202</td>
    <td>1201</td>
    <td>1202</td>
    </tr>
    <tr>
    <td>11楼</td>
    <td>1101</td>
    <td>1102</td>
    <td>1101</td>
    <td>1102</td>
    </tr>
    <tr>
    <td>10楼</td>
    <td>1001</td>
    <td>1002</td>
    <td>1001</td>
    <td>1002</td>
    </tr>
    <tr>
    <td>9楼</td>
    <td>901</td>
    <td>902</td>
    <td>901</td>
    <td>902</td>
    </tr>
    <tr>
    <td>8楼</td>
    <td>801</td>
    <td>802</td>
    <td>801</td>
    <td>802</td>
    </tr>
    <tr>
    <td>7楼</td>
    <td>701</td>
    <td>702</td>
    <td>701</td>
    <td>702</td>
    </tr>
    <tr>
    <td>6楼</td>
    <td>601</td>
    <td>602</td>
    <td>601</td>
    <td>602</td>
    </tr>
    <tr>
    <td>5楼</td>
    <td>501</td>
    <td>502</td>
    <td>501</td>
    <td>502</td>
    </tr>
    <tr>
    <td>4楼</td>
    <td>401</td>
    <td>402</td>
    <td>401</td>
    <td>402</td>
    </tr>
    <tr>
    <td>3楼</td>
    <td>301</td>
    <td>302</td>
    <td>301</td>
    <td>302</td>
    </tr>
    <tr>
    <td>2楼</td>
    <td>201</td>
    <td>202</td>
    <td>201</td>
    <td>202</td>
    </tr>
    <tr>
    <td>1楼</td>
    <td>101</td>
    <td>102</td>
    <td>101</td>
    <td>102</td>
    </tr>
    </tbody>
    </table>
    </body>
    <script src="http://res.layui.com/layui/dist/layui.js?t=1505105092499" charset="utf-8"></script>
    <script type="text/javascript">
    layui.use(['table'],function() {
    var table = layui.table;
    table.init('listset', {
    done: function(res, curr, count){
    console.log(res);
    }
    });

    });

    </script>
    </html>
    都精简这样了 还是不行 [挖鼻]
    0 回复
  • 0 回复
  • 贤心
    贤心 (管理员)
    15天前
    @用个名字真难 问题已记录,如确认是bug,2.1.3 会修复
    0 回复
  • @贤心 [亲亲] 加油
    0 回复
  • simpleno
    14天前
    @贤心 这恢复区已经被代码霸屏!!! 能在代码上加个折叠不 [偷笑]
    0 回复
  • @simpleno 我觉得应该加一个 回复区域的代码多 得拉好长
    0 回复
  • @贤心 找到原因了,复杂表头的问题
    0 回复