fastadmin 追加 switch切换
添加页面
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('设置金额')}:</label>
<div class="col-xs-12 col-sm-10">
<dl class="fieldlist" data-name="row[money]" data-template="fieldtpl">
<dd>
<ins>{:__('金额')}</ins>
<ins>{:__('使用状态')}</ins>
</dd>
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
<textarea name="row[money]" class="form-control hide" cols="30" rows="5"></textarea>
</dl>
</div>
</div>
<script type="text/html" id="fieldtpl">
<dd class="form-inline">
<input id="t-paymoney" class="form-control" name="row[<%=index%>][paymoney]" type="text" >
<input type="hidden" name="<%=name%>[<%=index%>][status]" id="c-status-<%=index%>" class="form-control" style="width:50px" placeholder="状态"/>
<a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-status-<%=index%>" data-yes="1" data-no="0">
<i class="fa fa-toggle-on text-success <%if(row.status!=1){%>fa-flip-horizontal text-gray<%}%> fa-2x"></i>
</a>
<span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
</dd>
</script>
编辑页面
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('设置金额')}:</label>
<div class="col-xs-12 col-sm-10">
<dl class="fieldlist" data-name="row[money]" data-template="fieldtpl">
<dd>
<ins>{:__('金额')}</ins>
<ins>{:__('使用状态')}</ins>
</dd>
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
<textarea name="row[money]" class="form-control hide" cols="30" rows="5">{$row.money|htmlentities}</textarea>
</dl>
</div>
</div>
<script type="text/html" id="fieldtpl">
<dd class="form-inline">
<input id="t-paymoney" class="form-control" name="row[<%=index%>][paymoney]" type="text" value="<%=row['paymoney']%>">
<input type="hidden" name="<%=name%>[<%=index%>][status]" id="c-status-<%=index%>" class="form-control" style="width:50px" value="<%=row.status%>" placeholder="状态"/>
<a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-status-<%=index%>" data-yes="1" data-no="0">
<i class="fa fa-toggle-on text-success <%if(row.status!=1){%>fa-flip-horizontal text-gray<%}%> fa-2x"></i>
</a>
<span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
</dd>
</script>