BootstrapTable加载按钮功能实例代码详解
程序员文章站
2022-04-28 23:41:43
1 html
1 html
<!--工具栏--> <div id="toolbar" class="btn-group"> <div style="float:left;margin-right: 10px"> <button class="btn btn-danger"onclick="openmodal('add',0,'')">增加</button> </div> </div> <!--工具栏--> <div id="toolbar" class="btn-group"> <div style="float:left;margin-right: 10px"> <button class="btn btn-danger" onclick="openmodal('add',0,'')">增加</button> </div> </div>
2 bootstarp
3 js打开弹窗
//打开新增或者是更新模态框 function openmodal(type,id,value){ globaltype=type; globalid=id; if(type=='add'){ // $('#money').val(''); $('#hotelservicename').val(''); $('#loginpassword').text("登录密码"); $('#operatehotelservicemodal').modal('show'); } // else if(type=='update'){ // $('#operatehotelservicetype').text("更新酒店设施(若不更新图片则无需选择图片,保持图片为空)"); // //设置设施id // $('#money').val(id); // //设置设施名称 // $('#hotelservicename').val(value); // //设置图片 // $('#operatehotelservicemodal').modal('show'); // } }
4 弹窗
<div id="operatehotelservicemodal"class="modal" tabindex="-1"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="blue bigger" id="operatehotelservicetype"></h4> </div> <form id="hotelserviceform"> <div class="modal-body overflow-visible"> <div class="row"> <div class="col-xs-12"> <div class="form-group"> <label class="col-sm-3 control-labelno-padding-right" for="bankname"> 选择银行:</label> <div class="col-sm-9"> <select class="form-control" id="bankname"> <option value="中国工商银行">中国工商银行</option> <option value="中国银行">中国银行</option> <option value="中国农业银行">中国农业银行</option> <option value="中国邮政银行">中国邮政银行</option> <option value="中国建设银行">中国建设银行</option> </select> </div> </div> <div style="height:25px"></div> <div class="form-group"> <label class="col-sm-3control-label no-padding-right" for="realname"> 真实姓名: </label> <div class="col-sm-9"> <input type="text" class="col-xs-10col-sm-12" id="realname" placeholder="请输入真实姓名" /> </div> </div> <div style="height:25px"></div> <div class="form-group"> <label class="col-sm-3 control-labelno-padding-right" for="bankidcard"> 身份证号: </label> <div class="col-sm-9"> <input type="text" class="col-xs-10col-sm-12" id="bankidcard" /> </div> </div> <div style="height:25px"></div> <div class="form-group"> <label class="col-sm-3 control-labelno-padding-right" for="banknumber"> 银行卡号: </label> <div class="col-sm-9"> <input type="text" class="col-xs-10col-sm-12" id="banknumber" /> </div> </div> <div style="height:25px"></div> <div class="form-group"> <label class="col-sm-3 control-labelno-padding-right" for="banknamezhi"> 开发支行: </label> <div class="col-sm-9"> <input type="text" class="col-xs-10col-sm-12" id="banknamezhi" /> </div> </div> <div style="height:25px"></div> <div class="form-group"> <label class="col-sm-3 control-labelno-padding-right" for="bankphone"> 银行卡预留电话: </label> <div class="col-sm-9"> <input type="text" class="col-xs-10col-sm-12" id="bankphone" /> </div> </div> </div> </div> </div> </form> <div class="modal-footer"> <button class="btn btn-sm" data-dismiss="modal"> <i class="icon-remove"></i> 取消 </button> <button class="btn btn-sm btn-primary" onclick="savebank()"> <i class="icon-ok"></i> 提交审核 </button> </div> </div> </div> </div><!-- page content ends -->
总结
以上所述是小编给大家介绍的bootstraptable加载按钮功能实例代码详解,希望对大家有所帮助