src/main/resources/static/admin/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js

(开头部分) 12KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/**
 * 基于bootstrap-table-fixed-columns修改
 * 支持左右列冻结、支持固定高度
 * Copyright (c) 2019 alcedo
 */
(function ($) {
    'use strict';

    $.extend($.fn.bootstrapTable.defaults, {
        fixedColumns: false,
        fixedNumber: 1,
        rightFixedColumns: false,
        rightFixedNumber: 1
    });

    var BootstrapTable = $.fn.bootstrapTable.Constructor,
        _initHeader = BootstrapTable.prototype.initHeader,
        _initBody = BootstrapTable.prototype.initBody,
        _resetView = BootstrapTable.prototype.resetView;

    BootstrapTable.prototype.initFixedColumns = function () {
        this.timeoutHeaderColumns_ = 0;
        this.timeoutBodyColumns_ = 0;
        if (this.options.fixedColumns) {
            this.$fixedHeader = $([
                '<div class="left-fixed-table-columns">',
                '<table>',
                '<thead></thead>',
                '</table>',
                '</div>'].join(''));
            
            this.$fixedHeader.find('table').attr('class', this.$el.attr('class'));
            this.$fixedHeaderColumns = this.$fixedHeader.find('thead');
            this.$tableHeader.before(this.$fixedHeader);

            this.$fixedBody = $([
                '<div class="left-fixed-body-columns">',
                '<table>',
                '<tbody></tbody>',
                '</table>',
                '</div>'].join(''));

            this.$fixedBody.find('table').attr('class', this.$el.attr('class'));
            this.$fixedBodyColumns = this.$fixedBody.find('tbody');
            this.$tableBody.before(this.$fixedBody);
        }
        if (this.options.rightFixedColumns) {
            this.$rightfixedBody = $([
                '<div class="right-fixed-table-columns">',
                '<table>',
                '<thead></thead>',
                '<tbody style="background-color: #fff;"></tbody>',
                '</table>',
                '</div>'].join(''));
            this.$rightfixedBody.find('table').attr('class', this.$el.attr('class'));
            this.$rightfixedHeaderColumns = this.$rightfixedBody.find('thead');
            this.$rightfixedBodyColumns = this.$rightfixedBody.find('tbody');
            this.$tableBody.before(this.$rightfixedBody);
            if (this.options.fixedColumns) {
                $('.right-fixed-table-columns').attr('style','right:0px');
后面还有 237 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。