如何使用bootstrap-table获取数据

如何使用bootstrap-table获取数据,第1张

var common_data

//得到数据

function getHotData() {

var temp = [getMyData(document.getElementById("hand1"))]

for (var i = 0i <temp.lengthi++) {

common_data[i] = temp[i]

}

return [JSON.stringify(common_data[0])]

}

原文: https://blog.csdn.net/a116475939/article/details/88527597

BootstrapTable.prototype.getRowByIndex = function (index) {

         if((index * 1+1)>this.options.data.length){

            throw new Error("Unknown method: 没有当前序号!")

         }

        return this.options.data[index * 1]

    }   

BootstrapTable.prototype.removeByIndex = function (index) {

  var len = this.options.data.length,

      row = this.getRowByIndex(index)

      if (row) {

          this.options.data.splice(this.options.data.indexOf(row), 1)

      }

      if (len === this.options.data.length) {

          return

      }

      this.initSearch()

      this.initPagination()

      this.initBody(true)

    } 

'getRowByIndex', 'removeByIndex'

$table.bootstrapTable('removeByIndex',0)//删除序号为0的数据

$table.bootstrapTable('getRowByIndex',0)//获取序号为0的数据


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/9944068.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-03
下一篇 2023-05-03

发表评论

登录后才能评论

评论列表(0条)

保存