【问题标题】:Editable cells formatting in bootstrap table引导表中的可编辑单元格格式
【发布时间】:2015-12-18 22:02:26
【问题描述】:

我使用bootstrap-tablebootstrap-table-editable 拥有可编辑的单元格。如果单元格是字符串化的 json,则可编辑单元格的格式不正确(作为字符串)。

jsfiddle

html

<table class="table table-striped table-bordered table-hover"  cellspacing="0" id="mainTable" data-click-to-select="true" data-show-toggle="true" data-show-columns="true" data-search="true" data-pagination="true">
    <thead>
    <tr>
        <th data-field="name" data-halign="center" data-align="left" data-sortable="true">Name</th>
        <th data-field="stargazers_count" data-halign="center" data-align="left" data-sortable="true">Stars</th>
        <th data-field="forks_count" data-halign="center" data-align="left" data-sortable="true" data-editable="true">Forks</th>
        <th data-field="description" data-halign="center" data-align="left" data-sortable="true" data-editable="true">Description</th>
    </tr>
    </thead>
</table>

javascript

$.fn.editable.defaults.mode = 'inline';

var data = [{name: 'John', stargazers_count: 232, forks_count: 214, description: "{x:5,y:6}"},
           {name: 'Craig', stargazers_count: 234, forks_count: 224, description: "{x:5,y:6}"},
           {name: 'Barry', stargazers_count: 238, forks_count: 234, description: "{x:5,y:6}"}]

$('table').bootstrapTable({
    data: data,
    sortable: true,
    editable: true
});

最后一列的单元格被格式化为[object Object]

【问题讨论】:

    标签: javascript jquery twitter-bootstrap twitter-bootstrap-3 bootstrap-table


    【解决方案1】:

    我在 Github 上打开了an issue,哪里有解决方案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多