kartik-v / yii2-grid

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

splitted by printing in chrome #741

Closed lowap closed 5 years ago

lowap commented 6 years ago

Prerequisites

Steps to reproduce the issue

  1. put a certain amount of lines or <hr /> or <br> in the view
  2. try to print the page using Chrome.

Expected behavior and actual behavior

When I follow those steps, I see by printing that GridView is splitted into two underneath each other each with header.

I was expecting one Gridview with one header by printing.

Environment

Browsers

Operating System

Libraries

Isolating the problem

with Firefox it's not happening.

use kartik\grid\GridView;
use yii\widgets\DetailView;

$this->title = Yii::t('yii', 'Print');
?>
<div>
    <div class="row">
        <span class="col-sm-6" style="float: left;">
            <span>
                Firm<br>
                Wbl Ltd.<br>
                hhstr 254<br>
                823 Ong<br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
            </span>
            <span style="font-size: 160%;">
                Lfs: Ga<br>
            </span>
            <span style="font-size: 160%;">
                <b>EX Wbl</b><br>
            </span>
        </span>
        <span class="col-sm-6" style="float: right">
            <b><span style="font-size: 160%;">LOWT</span><br>
            Fka Ltd.<br>
            Paurastr 4<br>
            891 Kon</b><br>
            Tel.: 300<br>
            FAX: 3006<br>
            Email: info -at- fka..gf.com<br>

            <?=
            DetailView::widget([
                'model' => $model,
                'options' => ['class' => 'table'],
                'attributes' => [
                    'number',
                    [
                        'attribute' => 'created_at',
                        'format' => 'date',
                    ],
                    [
                        'attribute' => 'created_by',
                        'format' => 'html',
                        'value' => $model->getCreatedBy()->one()->profile->name,
                    ],
                ],
            ]);
            ?>
        </span>
    </div>
    <hr />
    <div>
        Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna:<br>
        At vero eos et accusam et justo duo dolores et ea rebum.
    </div>
    <hr />
    <div class="table-responsive">
        <?=
        GridView::widget([
            'layout' => '{items}',
            'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getAlgs()->withAsMq(), 'sort' => false,]),
            'showPageSummary' => true,
            'columns' => [
                [
                    'attribute' => 'aonr',
                    'pageSummary' => 'SUM',
                ],
                'lnr',
                [
                    'attribute' => 'lier',
                    'contentOptions' => ['nowrap' => 'nowrap'],
                ],
                [
                    'attribute' => 'stk',
                    'pageSummary' => true,
                ],
                'adn',
                'slaenger'
            ]
        ])
        ?>
    </div>
    <div>
        Lorem ipsum dolor sit amet, consetetur<br>
        consetetur: At vero eos et accusam et justo duo dolores et ea rebum. <u>At vero eos et accusam et justo duo dolores et ea rebum!</u><br>
        <span style="font-size: 160%;">! At vero eos et accusam et justo duo dolores et ea rebum !</span><br>
        <span style="float: left;">
            et accusam et<br>
            <br>
            dolores et ea rebum<br>
            accusam et justo
        </span>
    </div>
</div>
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/52844439-splitted-by-printing-in-chrome?utm_campaign=plugin&utm_content=tracker%2F607905&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F607905&utm_medium=issues&utm_source=github).
stale[bot] commented 5 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.

lowap commented 5 years ago

Hi, what else can I do to make something happen? Thanks.

stale[bot] commented 5 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.