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

subGroupOf 2nd, 3rd level in 3.3.6 #971

Closed
5 of 6 tasks
nimer- opened this issue Nov 25, 2020 · 3 comments
Closed
5 of 6 tasks

subGroupOf 2nd, 3rd level in 3.3.6 #971

nimer- opened this issue Nov 25, 2020 · 3 comments

Comments

@nimer-
Copy link

nimer- commented Nov 25, 2020

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • The issue still exists against the latest master branch of yii2-grid.
  • This is not an usage question. I confirm having gone through and read the documentation and demos.
  • This is not a general programming / coding question. (Those should be directed to the webtips Q & A forum).
  • I have attempted to find the simplest possible steps to reproduce the issue.
  • I have included a failing test as a pull request (Optional).

Libraries

  • jQuery version: 3.5.1
  • yii2-grid version: 3.3.6
  • kv-grid-group.js 3.2.7

Steps to reproduce the issue

There is still an issue with subgroups of 2nd, 3rd level. It does not work without groupfooter attribute. (Actually there is closed issue for this, but it was closed because you could not reproduce it and it was not well documented - posted reply there 2 months ago - so i am trying again)

using your example from: https://demos.krajee.com/group-grid-demo/7 :

echo GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => null,
    'showPageSummary' => true,
    'pjax' => true,
    'hover' => true,
    'panel' => ['type' => 'primary', 'heading' => 'Grid Grouping Example'],
    'toggleDataContainer' => ['class' => 'btn-group mr-2'],
    'columns' => [
        // note that you MUST NOT have the first column as a grid group
        // to achieve that add a dummy hidden column like shown below
        ['class' => 'kartik\grid\SerialColumn', 'hidden' => true],
        ['attribute' => 'year',  'group' => true, 'groupFooter' => $gfYear, 'pageSummary' => 'Page Summary'],
        ['attribute' => 'month',  'group' => true, 'subGroupOf' => 1, 'groupFooter' => $gfMonth],
        ['attribute' => 'cat',  'group' => true, 'subGroupOf' => 2, 'groupFooter' => $gfCategory],
        ['attribute' => 'region',  'group' => true, 'subGroupOf' => 3, /*'groupFooter' => $gfRegion*/],
        ['attribute' => 'id', 'label' => 'ID', 'hAlign' => 'center', 'width' => '150px'],
        ['attribute' => 'amount', 'label' => 'Amount ($)', 'format' => ['decimal',  2], 'hAlign' => 'right', 'width' => '150px', 'pageSummary' => true],
    ],
]);

it looks like this:
grid-group

Emptied cache, tried different browsers, different computers actually, but it persists.

@kartik-v
Copy link
Owner

@NIMER the example works fine as seen in this group demo # 7 - you may need to check if you have the latest code. Can you cross check the gridview JS assets that are being loaded on the page for your app and compare it with the assets loaded on the demo site link above and confirm they are same

@nimer-
Copy link
Author

nimer- commented Nov 26, 2020

@kartik-v You are correct with the latest version of code. I am using non-minified (for dev purposes) and on the demo page is minified.
As seen here: https://github.com/kartik-v/yii2-grid/blob/master/src/assets/js/kv-grid-group.js and here https://github.com/kartik-v/yii2-grid/blob/master/src/assets/js/kv-grid-group.min.js There are different versions (3.2.7 for non minified and 3.3.6 for minified version) in master branch.
Minified version of code is working fine. 👍

@kartik-v
Copy link
Owner

It should work with the non-minified source as well ... actually the PHP Doc version 3.2.7 is a typo error and will correct it.

For the non-minified source - it seems some cache issue at your end loading old obsolete assets.

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

No branches or pull requests

2 participants