首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从data-url引导表格数据

从data-url引导表格数据
EN

Stack Overflow用户
提问于 2014-11-19 12:24:42
回答 1查看 1.3K关注 0票数 0

我正在使用nodejs和jade以及bootstrap插件Bootstrap table。我很难让它正常工作。

这是用玉做的桌子的一部分

代码语言:javascript
复制
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

该表的加载方式如下:

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

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

EN

回答 1

Stack Overflow用户

发布于 2014-12-06 20:29:42

试试这个;

data-url="reports.json“

代码语言:javascript
复制
<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将会是

代码语言:javascript
复制
[
{
    "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}

]

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27008920

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档