fastadmin 多选按钮

1 mysql

2 js

{field: 'hobbydata', title: __('Hobbydata'), searchList: {"music":__('Hobbydata music'),"reading":__('Hobbydata reading'),"swimming":__('Hobbydata swimming')}, operate:'FIND_IN_SET', formatter: Table.api.formatter.label}

3 add.html

<div class="form-group">
    <label class="control-label col-xs-12 col-sm-2">{:__('Hobbydata')}:</label>
    <div class="col-xs-12 col-sm-8">
        <div class="checkbox">
        {foreach name="hobbydataList" item="vo"}
        <label for="row[hobbydata][]-{$key}"><input id="row[hobbydata][]-{$key}" name="row[hobbydata][]" type="checkbox" value="{$key}" {in name="key" value=""}checked{/in} /> {$vo}</label> 
        {/foreach}
        </div>
    </div>
</div>

4 edit.html

<div class="form-group">
    <label class="control-label col-xs-12 col-sm-2">{:__('Hobbydata')}:</label>
    <div class="col-xs-12 col-sm-8">
        <div class="checkbox">
        {foreach name="hobbydataList" item="vo"}
        <label for="row[hobbydata][]-{$key}"><input id="row[hobbydata][]-{$key}" name="row[hobbydata][]" type="checkbox" value="{$key}" {in name="key" value="$row.hobbydata"}checked{/in} /> {$vo}</label> 
        {/foreach}
        </div>
    </div>
</div>
posted @ 2020-07-13 14:46  CanyingV  阅读(2067)  评论(0编辑  收藏  举报