bootstrap-select怎么刷新数据
2017-07-23 21:47
477 查看
在使用bootstrap-select时,需要刷新数据。只需要调用bootstrap-select内置的方法就可以了。
说下解决思路,把option标签的内容拼接到select里面。其中 goodsName0是select标签的id。
说下解决思路,把option标签的内容拼接到select里面。其中 goodsName0是select标签的id。
this.dataservice.getData(this.url[0]).then(res => { let tempData = res.rows; let options = "<option value=''>请选择</option>"; tempData.forEach(el => { options += "<option value='" + el.id + "'>" + el.value + "</option>"; }); return options; }).then(options => { $("#goodsName0").empty(); $('#goodsName0').append(options); $('#goodsName0').selectpicker('render'); $('#goodsName0').selectpicker('refresh'); $('#goodsName0').selectpicker(); })
相关文章推荐
- Bootstrap 的select控件怎么选中或是异步刷新。
- bootstrap-select2 多选搜索,远程数据,
- bootstrap jquery dataTable 异步ajax刷新表格数据的实现方法
- bootstrap-select下拉搜索插件 动态加载自己数据的二级联动
- Bootstrap-Select 动态加载数据的小记
- 异步网络获取数据,怎么在获取数据后刷新数据。
- bootstrap-select 动态加载数据不显示的问题
- JavaScript当中网页刷新后数值(text、radio、checkbox、select、textarea)保持不变(输入域数据保持)的简单方法
- BootStrap selectpicker后台动态绑定数据
- bootstrap 链接打开模态框数据无法刷新的解决方案
- bootstrap-select 与 jquery validate 页面数据检验 错误
- Extjs 4 单条刷新数据(单行操作)定时器监听 getAt();.getSelectionModel().select(flag);
- 解决bootstrap-select 动态加载数据不显示的问题
- 关于不是tableView怎么刷新数据
- 如何让SELECT 查询结果额外增加自动递增序号 如果数据表本身并不内含自动递增编号的字段时,要怎么做才能够让SELECT查询结果额外增加自动递增序号呢?下列五种方法供您参考: USE test;
- bootstrap-select 联动框 后台php模拟数据接受
- 级联两个bootstrap-table。一张表显示相关的数据,通过点击这张表的某一行,传过去对应的ID,刷新另外一张表。
- bootstrap jquery dataTable 异步ajax刷新表格数据
- bootStrap table动态刷新数据
- 使用bootstrap-select多选下拉框和ajax请求到的数据添加到下拉框