首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用autoform和html表添加新行

使用autoform和html表添加新行
EN

Stack Overflow用户
提问于 2015-11-04 20:04:55
回答 1查看 106关注 0票数 1

我正在试验Autoforms和html表中的数组字段。到目前为止,我可以修改和删除行,但我在解决如何添加新行时遇到了麻烦。“添加”按钮似乎没有任何作用。

到目前为止我的代码如下:

代码语言:javascript
复制
  {{#autoForm id="eventDatesForm" type="update" collection="Events" doc=this buttonContent="Save"}}

      <h2>Event Dates</h2>
      {{> afQuickField name="timezone"}}
      <table class="table table-bordered table-hover table-condensed">
        <thead>
          <tr>
            <th>Slice Start</th>
            <th>Slice End</th>
            <th><button type="button" class="btn btn-primary autoform-add-item" data-autoform-field="{{this.atts.name}}" data-autoform-minCount="{{this.atts.minCount}}" data-autoform-maxCount="{{this.atts.maxCount}}"><span class="glyphicon glyphicon-plus"></span></button></th>
          </tr>
        </thead>
      {{#afEachArrayItem name="WiFiOffloadSettings"}}
      <tbody>
        <tr>
          <td>{{> afFieldInput name=this.current.offloadSliceStart type=datetime}}</td>
          <td>{{> afFieldInput name=this.current.offloadSliceEnd type=datetime}}</td>
          <td><button type="button" class="btn btn-danger btn-sm autoform-remove-item"><span class="glyphicon glyphicon-minus"></span></button></td>
        </tr>
      </tbody>
     {{/afEachArrayItem}}
   </table>
  <button type="submit" class="btn btn-primary">Save</button>
  {{/autoForm}}
EN

回答 1

Stack Overflow用户

发布于 2016-09-10 04:18:20

在Add按钮中,尝试使用名称"WiFiOffloadSettings“。

那是,

代码语言:javascript
复制
<button type="button" class="btn btn-primary autoform-add-item" 
data-autoform-field="WiFiOffloadSettings" data-autoform-minCount="
{{this.atts.minCount}}" data-autoform-maxCount= {this.atts.maxCount}}">
<span class="glyphicon glyphicon-plus"></span> </button>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33521445

复制
相关文章

相似问题

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