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

Error when several ExpandRowColumn columns used #862

Closed
sptik12 opened this issue Nov 29, 2018 · 2 comments
Closed

Error when several ExpandRowColumn columns used #862

sptik12 opened this issue Nov 29, 2018 · 2 comments

Comments

@sptik12
Copy link

sptik12 commented Nov 29, 2018

When we are using several ExpandRowColumn with detailUrl property url from the last column is always called.

Please take look at our code:

			[
				'class' => '\kartik\grid\ExpandRowColumn',
				'value' => function ($model, $key, $index, $column) {
					return GridView::ROW_COLLAPSED;
				},
				'detailUrl' => Url::to(['files-child-courses']),
				'expandOneOnly' => true,
				'allowBatchToggle' =>false,
				'disabled' => function ($model, $key, $index, $column) {
					....
				},
			],

			[
				'class' => '\kartik\grid\ExpandRowColumn',
				'value' => function ($model, $key, $index, $column) {
					return GridView::ROW_COLLAPSED;
				},
				'detailUrl' => Url::to(['child-courses']),
				'expandOneOnly' => true,
				'allowBatchToggle' =>false,
				'disabled' => function ($model, $key, $index, $column) {
					....
				},
			],

			[
				'class' => '\kartik\grid\ExpandRowColumn',
				'value' => function ($model, $key, $index, $column) {
					return GridView::ROW_COLLAPSED;
				},
				'detailUrl' => Url::to(['users']),
				'expandOneOnly' => true,
				'allowBatchToggle' =>false,
				'disabled' => function ($model, $key, $index, $column) {
					....
				},
			]

In this case in all 3 columns we'll get 'users' link.

@kartik-v
Copy link
Owner

kartik-v commented Dec 4, 2018

Currently expand row column is intended be ROW specific (which means only one expand detail is possible for one row - which is the reason the last expand column is the one showing the data). This will need additional enhancement to figure out how to achieve your use case. Will need to check when I get time.

@kartik-v
Copy link
Owner

kartik-v commented Dec 5, 2018

Check by updating to the latest enhancement provided above.

kartik-v added a commit that referenced this issue Dec 5, 2018
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