bootstrap-table的行数据使用array和json的区别
来源:互联网 发布:网络监控机多少钱 编辑:程序博客网 时间:2024/06/05 10:20
//bootstrap-table中的data参数传的只能是数组数据,json数据不行,通过url参数传数据时,可以传json数据,但此时还需要配置参数
responseHandler: function (res) {
return res.rows;
responseHandler: function (res) {
return res.rows;
}
返回json数据中的行数据数组,所以最终使用的还是json中的数组。可通过
Object.prototype.toString.call(newData).toLowerCase()
判断数据是数组还是json对象,数组添加新数据不知道数组索引的情况下可以使用push()函数,
if(devType == "信号机"&&unit=="A单位") {var newData = [];for(var p in wcssdata) {console.log(wcssdata[p]);if(wcssdata[p].type == devType&& wcssdata[p].maintain_unit==unit) {newData.push(wcssdata[p]); //给数组添加新对象数据//newData[0]=wcssdata[p];}}console.log(newData)console.log(Object.prototype.toString.call(newData).toLowerCase())//[object array]console.log(Object.prototype.toString.call(wcssdata).toLowerCase())$("#table").bootstrapTable('refreshOptions', {data: newData,});}
阅读全文
0 0
- bootstrap-table的行数据使用array和json的区别
- bootstrap-table的使用
- bootstrap-table的使用
- bootstrap-table修改行数据
- BootStrap-table 客户端分页和服务端分页的区别
- bootstrap-table 插件的使用
- Bootstrap Table的使用小结
- bootstrap table插件的使用
- bootstrap的table表格使用
- bootstrap table 获取选中行数据
- Bootstrap的table类的使用
- Bootstrap table的一些简单使用总结
- 关于bootstrap table 插件的使用总结
- 使用bootstrap-table遇到的一个坑
- Bootstrap table的一些简单使用总结
- bootstrap-table的使用与条件搜索
- Bootstrap table的一些简单使用总结
- bootstrap-table使用时遇到的坑
- 清除Eclipse工作空间列表
- 遍历(一)jquery $().each和$.each()
- DMA原理解析
- 网页中的cookie
- Docker背后的内核知识——cgroups资源限制
- bootstrap-table的行数据使用array和json的区别
- 遍历(二)javascript的Foreach语法
- Kotlin语言学习
- ScrollView嵌套ListView NullPointException
- android 面试题
- 数字货币开发专题(钱包搭建下载好了怎么挖矿)
- 23种设计模式详解
- Linux踢出其他正在SSH登陆用户
- Kotlin_package