/**
* @author zhixin wen <wenzhixin2010@gmail.com>
* version: 1.9.1
* https://github.com/wenzhixin/bootstrap-table/
*/
!function ($) {
'use strict';
// TOOLS DEFINITION
// ======================
var cachedWidth = null;
// it only does '%s', and return '' when arguments are undefined
var sprintf = function (str) {
var args = arguments,
flag = true,
i = 1;
str = str.replace(/%s/g, function () {
var arg = args[i++];
if (typeof arg === 'undefined') {
flag = false;
return '';
}
return arg;
});
return flag ? str : '';
};
var getPropertyFromOther = function (list, from, to, value) {
var result = '';
$.each(list, function (i, item) {
if (item[from] === value) {
result = item[to];
return false;
}
return true;
});
return result;
};
var getFieldIndex = function (columns, field) {
var index = -1;
$.each(columns, function (i, column) {
if (column.field === field) {
index = i;
return false;
}
return true;
});
return index;
};
// http://jsfiddle.net/wenyi/47nz7ez9/3/
var setFieldIndex = function (columns) {
var i, j, k,
totalCol = 0,
flag = [];
for (i = 0; i < columns[0].length; i++) {
totalCol += columns[0][i].colspan || 1;
}
for (i = 0; i < columns.length; i++) {
flag[i] = [];
for (j = 0; j < totalCol; j++) {
flag[i][j] = false;
}
}
for (i = 0; i < columns.length; i++) {
for (j = 0; j < columns[i].length; j++) {
var r = columns[i][j],
rowspan = r.rowspan || 1,
colspan = r.colspan || 1,
index = $.inArray(false, flag[i]);
if (colspan === 1) {
r.fieldIndex = index;
// when field is undefined, use index instead
if (typeof r.field === 'undefined') {
r.field = index;
}
}
for (k = 0; k < rowspan; k++) {
flag[i + k][index] = true;
}
for (k = 0; k < colspan; k++) {
flag[i][index + k] = true;
}
}
}
};
var getScrollBarWidth = function () {
if (cachedWidth === null) {
var inner = $('<p/>').addClass('fixed-table-scroll-inner'),
outer = $('<div/>').addClass('fixed-table-scroll-outer'),
w1, w2;
outer.append(inner);
$('body').append(outer);
w1 = inner[0].offsetWidth;
outer.css('overflow', 'scroll');
w2 = inner[0].offsetWidth;
if (w1 === w2) {
w2 = outer[0].clientWidth;
}
outer.remove();
cachedWidth = w1 - w2;
}
return cachedWidth;
};
var calculateObjectValue = function (self, name, args, defaultValue) {
var func = name;
if (typeof name === 'string') {
// support obj.func1.func2
var names = name.split('.');
if (names.length > 1) {
func = window;
$.each(names, function (i, f) {
func = func[f];
});
} else {
func = window[name];
}
}
if (typeof func === 'object') {
return func;
}
if (typeof func === 'function') {
return func.apply(self, args);
}
if (!func && typeof name === 'string' && sprintf.apply(this, [name].concat(args))) {
return sprintf.apply(this, [name].concat(args));
}
return defaultValue;
};
var compareObjects = function (objectA, objectB, compareLength) {
// Create arrays of property names
var objectAProperties = Object.getOwnPropertyNames(objectA),
objectBProperties = Object.getOwnPropertyNames(objectB),
propName = '';
if (compareLength) {
// If number of properties is different, objects are not equivalent
if (objectAProperties.length !== objectBProperties.length) {
return false;
}
}
for (var i = 0; i < objectAProperties.length; i++) {
propName = objectAProperties[i];
// If the property is not in the object B properties, continue with the next property
if ($.inArray(propName, objectBProperties) > -1) {
// If values of same property are not equal, objects are not equivalent
if (objectA[propName] !== objectB[propName]) {
return false;
}
}
}
// If we made it this far, objects are considered equivalent
return true;
};
var escapeHTML = function (text) {
if (typeof text === 'string') {
return text
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/"/g, """)
.replace(/'/g, "'");
}
return text;
};
var getRealHeight = function ($el) {
var height = 0;
$el.children().each(function () {
if (height < $(this).outerHeight(true)) {
height = $(this).outerHeight(true);
}
});
return height;
};
var getRealDataAttr = function (dataAttr) {
for (var attr in dataAttr) {
var auxAttr = attr.split(/(?=[A-Z])/).join('-').toLowerCase();
if (auxAttr !== attr) {
dataAttr[auxAttr] = dataAttr[attr];
delete dataAttr[attr];
}
}
return dataAttr;
};
var getItemField = function (item, field) {
var value = item;
if (typeof field !== 'string' || item.hasOwnProperty(field)) {
return item[field];
}
var props = field.split('.');
for (var p in props) {
value = value[props[p]];
}
return value;
};
// BOOTSTRAP TABLE CLASS DEFINITION
// ======================
var BootstrapTable = function (el, options) {
this.options = options;
this.$el = $(el);
this.$el_ = this.$el.clone();
this.timeoutId_ = 0;
this.timeoutFooter_ = 0;
this.init();
};
BootstrapTable.DEFAULTS = {
classes: 'table table-hover',
locale: undefined,
height: undefined,
undefinedText: '-',
sortName: undefined,
sortOrder: 'asc',
striped: false,
columns: [[]],
data: [],
dataField: 'rows',
method: 'get',
url: undefined,
ajax: undefined,
cache: true,
contentType: 'application/json',
dataType: 'json',
ajaxOptions: {},
queryParams: function (params) {
return params;
},
queryParamsType: 'limit', // undefined
responseHandler: function (res) {
return res;
},
pagination: false,
onlyInfoPagination: false,
sidePagination: 'client', // client or server
totalRows: 0, // server side need to set
pageNumber: 1,
pageSize: 10,
pageList: [10, 25, 50, 100],
paginationHAlign: 'right', //right, left
paginationVAlign: 'bottom', //bottom, top, both
paginationDetailHAlign: 'left', //right, left
paginationFirstText: '«',
paginationPreText: '‹',
paginationNextText:
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
bootstrap-table,前端分页框架 (126个子文件)
bootstrap-table-group-by.css 24KB
bootstrap-table.css 7KB
bootstrap-table.min.css 5KB
bootstrap-table-reorder-rows.css 819B
bootstrap-table.js 94KB
bootstrap-table.min.js 47KB
bootstrap-table-locale-all.js 47KB
bootstrap-table-locale-all.min.js 27KB
bootstrap-table-filter-control.js 16KB
bootstrap-table-multiple-sort.js 15KB
bootstrap-table-cookie.js 13KB
bootstrap-table-accent-neutralise.js 11KB
bootstrap-table-multiple-sort.min.js 9KB
bootstrap-table-toolbar.js 8KB
bootstrap-table-group-by.js 8KB
bootstrap-table-filter-control.min.js 7KB
bootstrap-table-cookie.min.js 6KB
bootstrap-table-accent-neutralise.min.js 6KB
bootstrap-table-toolbar.min.js 5KB
bootstrap-table-export.js 4KB
bootstrap-table-angular.js 4KB
bootstrap-table-mobile.js 4KB
bootstrap-table-editable.js 4KB
bootstrap-table-reorder-columns.js 4KB
bootstrap-table-group-by.min.js 3KB
bootstrap-table-reorder-rows.js 3KB
bootstrap-table-multiple-search.js 3KB
bootstrap-table-key-events.js 3KB
bootstrap-table-resizable.js 2KB
bootstrap-table-angular.min.js 2KB
bootstrap-table-editable.min.js 2KB
bootstrap-table-filter.js 2KB
bootstrap-table-reorder-columns.min.js 2KB
bootstrap-table-export.min.js 2KB
bootstrap-table-flat-json.js 2KB
bootstrap-table-reorder-rows.min.js 2KB
bootstrap-table-mobile.min.js 2KB
bootstrap-table-ka-GE.js 2KB
bootstrap-table-ja-JP.js 1KB
bootstrap-table-fa-IR.js 1KB
bootstrap-table-hr-HR.js 1KB
bootstrap-table-cs-CZ.js 1KB
bootstrap-table-ms-MY.js 1KB
bootstrap-table-th-TH.js 1KB
bootstrap-table-filter.min.js 1KB
bootstrap-table-es-ES.js 1KB
bootstrap-table-et-EE.js 1KB
bootstrap-table-fr-FR.js 1KB
bootstrap-table-hu-HU.js 1KB
bootstrap-table-ro-RO.js 1KB
bootstrap-table-ar-SA.js 1KB
bootstrap-table-ca-ES.js 1KB
bootstrap-table-resizable.min.js 1KB
bootstrap-table-pt-BR.js 1KB
bootstrap-table-multiple-search.min.js 1KB
bootstrap-table-en-US.js 1KB
bootstrap-table-zh-CN.js 1KB
bootstrap-table-zh-TW.js 1KB
bootstrap-table-uk-UA.js 1KB
bootstrap-table-es-CR.js 1KB
bootstrap-table-es-NI.js 1KB
bootstrap-table-tr-TR.js 1KB
bootstrap-table-af-ZA.js 1KB
bootstrap-table-ru-RU.js 1KB
bootstrap-table-es-SP.js 1KB
bootstrap-table-ka-GE.min.js 1KB
bootstrap-table-ko-KR.js 1KB
bootstrap-table-ur-PK.js 1KB
bootstrap-table-key-events.min.js 1KB
bootstrap-table-it-IT.js 1KB
bootstrap-table-sk-SK.js 1KB
bootstrap-table-pl-PL.js 1KB
bootstrap-table-da-DK.js 1KB
bootstrap-table-sv-SE.js 1KB
bootstrap-table-nb-NO.js 1KB
bootstrap-table-es-MX.js 1KB
bootstrap-table-de-DE.js 999B
bootstrap-table-th-TH.min.js 985B
bootstrap-table-el-GR.js 980B
bootstrap-table-natural-sorting.js 960B
bootstrap-table-ja-JP.min.js 950B
bootstrap-table-fa-IR.min.js 949B
bootstrap-table-es-AR.js 938B
bootstrap-table-ms-MY.min.js 921B
bootstrap-table-ar-SA.min.js 904B
bootstrap-table-et-EE.min.js 897B
bootstrap-table-cs-CZ.min.js 890B
bootstrap-table-es-ES.min.js 885B
bootstrap-table-hr-HR.min.js 880B
bootstrap-table-ro-RO.min.js 874B
bootstrap-table-hu-HU.min.js 874B
bootstrap-table-ca-ES.min.js 869B
bootstrap-table-uk-UA.min.js 865B
bootstrap-table-vi-VN.js 863B
bootstrap-table-fr-BE.js 863B
bootstrap-table-pt-PT.js 859B
bootstrap-table-zh-CN.min.js 852B
bootstrap-table-zh-TW.min.js 846B
bootstrap-table-ru-RU.min.js 846B
bootstrap-table-fr-FR.min.js 834B
共 126 条
- 1
- 2
不住心
- 粉丝: 1
- 资源: 22
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页