http://www.xueh188.top/index.php/archives/26/

Add.html

添加一个选择按钮

<div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-goods_name" data-rule="required" class="form-control" name="row[goods_name]" type="text" value="" readonly="readonly">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="fachoose-goods" class="btn btn-primary fachoose-goods" data-input-id="c-goods"  data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <input id="c-goods_id"  data-rule="" class="form-control" name="row[goods_id]" type="hidden" value="">
            <!--            <ul class="row list-inline plupload-preview" id="p-image"></ul>-->
        </div>
    </div>

Add js

$(".fachoose-goods").click(function () {
                Fast.api.open('groupbuy/group_buy/search_goods', __('Goods'), {
                    callback:function(data){
                        console.log(data.goods_id);
                        console.log(data.goods_name);
                        //在这里可以接收弹出层中使用`Fast.api.close(data)`进行回传数据
                        $("#c-goods_id").val(data.goods_id);
                        $("#c-goods_name").val(data.goods_name);
                    }
                });
            })

search_goods html

<button type="reset" class="btn btn-primary btn-embossed btn-close">{:__('OK')}</button>

search_goods JS

 $(".btn-close").click(function (e) {
                var rows = table.bootstrapTable('getSelections');
                if(rows.length == 0){
                    Toastr.info("至少选择一项商品");
                    return;
                }
                var goods_ids = Table.api.selectedids(table);
                var goods_name =rows[0].goods_name;
                console.log(goods_ids[0]);
                console.log(goods_name);
                Fast.api.close({goods_id:goods_ids[0],goods_name:goods_name});
            })
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值