fastadmin 下拉框(添加关联表id)

2022-12-14 09:55:39 浏览数 (1)

1 add.html

代码语言:javascript复制
<div class="form-group">
    <label class="control-label col-xs-12 col-sm-2">{:__('Cate_id')}:</label>
    <div class="col-xs-12 col-sm-8">
        <input id="c-cate_id" data-rule="required" data-source="test/cate/index" data-primary-key="cate_id" data-field="cate_name"  class="form-control selectpage" name="row[cate_id]" type="text" value="">
    </div>
</div>

2 edit.html

代码语言:javascript复制
<div class="form-group">
    <label class="control-label col-xs-12 col-sm-2">{:__('Cate_id')}:</label>
    <div class="col-xs-12 col-sm-8">
        <input id="c-cate_id" data-rule="required" data-source="test/cate/index" data-primary-key="cate_id" data-field="cate_name" class="form-control selectpage" name="row[cate_id]" type="text" value="{$row.cate_id|htmlentities}">
    </div>
</div>

0 人点赞