【问题标题】:Boostrap table data from data-url来自 data-url 的引导表数据
【发布时间】:2014-12-06 20:29:41
【问题描述】:

我正在使用带有引导插件引导表的 nodejs 和玉。 我无法让它工作。

这是玉石桌的部分

h1 Reported Users
   table(data-toggle="table", data-url=reports)
      thead
         tr
           th(data-toggle="matched_uid") Reported User ID
           th(data-toggle="reported_name") Reported User Name
           th(data-toggle="email") Reported User Email
           th(data-toggle="message") Reported Offense(s)
           th(data-toggle="reporter_name") Reported By

表格加载如下:

当我查看浏览器控制台时,我认为 data-url 中的 results 加载正确:

我的data-url 有效吗?有谁知道可能出了什么问题? 请帮忙。提前致谢!

【问题讨论】:

    标签: javascript node.js twitter-bootstrap html-table


    【解决方案1】:

    试试这个;

    data-url="reports.json"

    <thead>
        <tr>
            <th data-field="matched_uid">Reported User ID</th>
            <th data-field="reported_name">Reported User Name</th>
            <th data-field="email">Reported User Email</th>
            <th data-field="message">Reported Offense(s)</th>
            <th data-field="reporter_name">Reported By</th>
        </tr>
    </thead>
    

    你的 json 将是

    [
    {
        "matched_uid": "sample",
        "reported_name": "sample",
        "email": "sample",
        "message": "sample",
        "reporter_name":"sample"
    },
    {
        "matched_uid": "sample",
        "reported_name": "sample",
        "email": "sample",
        "message": "sample"
        "reporter_name":"sample"
    },
    {MORE},
    {MORE},
    {LAST}
    

    ]

    【讨论】:

      猜你喜欢
      • 2015-02-23
      • 2021-02-18
      • 1970-01-01
      • 1970-01-01
      • 2016-01-19
      • 2019-06-04
      • 2012-08-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多