Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap 4 #426

Open
cidmacedo opened this issue Sep 28, 2019 · 1 comment
Open

Bootstrap 4 #426

cidmacedo opened this issue Sep 28, 2019 · 1 comment

Comments

@cidmacedo
Copy link

Hello friend´s, i need help, my bootgrid does not running in Bootstrap4 and i don´t know how to convert this. I need some help

Thanks.

@matiaskusack
Copy link

Hi, try adding this (after adding jquer.bootgrid.js):

; (function ($, window, undefined) {
    "use strict";

    $.extend($.fn.bootgrid.Constructor.defaults.css, {
        search: 'table-search',
        actions: 'btn-group table-actions',
        iconRefresh: 'fa-sync',
        iconDown: 'fa-sort-down',
        iconUp: 'fa-sort-up',
        iconColumns: 'fa-th-list',
        paginationButton: 'page-link',
        icon: 'icon fa',
    });

    $.extend($.fn.bootgrid.Constructor.defaults.templates, {
        icon: '<i class="icon fa {{ctx.iconCss}}"></i>',
        search: `
                        <div class="btn-group {{css.search}}">
                            <div class="input-group mb-2">
                                <div class="input-group-prepend">
                                    <div class="input-group-text">
                                        <i class="fas fa-search"></i>
                                    </div>
                                </div>
                                <input type="text" class="form-control {{css.searchField}}" id="inlineFormInputGroup" placeholder="{{lbl.search}}">
                            </div>
                        </div>`,
        actionButton: `
                        <button class="btn btn-light" type="button" title="{{ctx.text}}">
                            {{ctx.content}}
                            <span>{{ctx.text}}</span>
                        </button>`,
        actionDropDown: `
                        <div class="{{css.dropDownMenu}}">
                            <button class="btn btn-light dropdown-toggle" type="button" data-toggle="dropdown">
                                <span class="{{css.dropDownMenuText}}">{{ctx.content}}</span>
                                <span class="caret"></span>
                                <span></span>
                            </button>
                            <ul class="{{css.dropDownMenuItems}}" role="menu"></ul>
                        </div>`,
        paginationItem: `
                        <li class="paginate_button page-item {{ctx.css}}">
                            <a data-page="{{ctx.page}}" class="{{css.paginationButton}}" href="javascript:void(0);">
                                {{ctx.text}}
                            </a>
                        </li>`,
        loading: `<tr><td colspan="{{ctx.columns}}" class="text-center"><i class="fa fa-sync fa-spin"></i></td></tr>`
    });
})(jQuery, window);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants