當前位置:編程學習大全網 - 網站源碼 - bootstrap table 通過index獲取行信息

bootstrap table 通過index獲取行信息

原文: /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的數據

  • 上一篇:82的源碼補碼是什麽?
  • 下一篇:floor函數的pascal
  • copyright 2024編程學習大全網