kartik-v / yii2-grid

Enhanced GridView with various utilities for Yii Framework 2.0
http://demos.krajee.com/grid
Other
557 stars 302 forks source link

Feature request: Floating Page Summary footer #941

Closed ghost closed 2 years ago

ghost commented 4 years ago

Hi, I've searched in documentation and in the issue in both open and closed tickets and cannot find a solution. I need to a add a floating footer containing the page summary for the gridview, the problem is that the colums doesn't align well with the gridview. It would be really great to have settings similar to

'floatHeader',
'floatHeaderOptions',

Thanks

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

maxxer commented 4 years ago

@kartik-v would you consider sponsoring for this feature?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kartik-v commented 4 years ago

Hi - i have not got time to look into this - marking this as a potential enhancement so that the bot does not close this. Will appreciate any help surely. Thanks.

tmendesilva commented 2 years ago

My trick, with after container enabled, just move summary recalculating footer summary td's width based on table td's width on pjax:success

            function moveSummary() {
                $('tbody.kv-page-summary-container').appendTo($('<table class="mb-0"></table>')).appendTo($('.kv-panel-after'))
                const tableTds = $('.kv-grid-container table tbody tr.billing-grid:first td');
                const footerTds = $('tbody.kv-page-summary-container tr td');
                footerTds.each(function (i, el) {
                    $(el).css('min-width', tableTds.eq(i).outerWidth());
                });
            }

            // Apos filtros e ordenações
            $('#my-grid-pjax').on('pjax:success', function (data, status, xhr, options) {
                moveSummary()
            });

css

.kv-grid-container {
    height: calc(100vh - 253px);
    font-size: 13px;
    line-height: 13px;
}

tbody.kv-page-summary-container tr td {
    font-size: 13px;
    padding: 0.3rem;
}

#my-grid .kv-panel-after {
    padding: 0;
    overflow-x: hidden;
    white-space: nowrap;
}
kartik-v commented 2 years ago

This will be resolved via a totally new enhancement #1009 which offers more

kartik-v commented 2 years ago

The repo is updated with the new functionality. Cross check the new demos page to see this in action (make sure you have purged your browser cache and refreshed).