Skip to content

Conversation

@slischka
Copy link

@slischka slischka commented Mar 6, 2019

Simplifies:

$datagrid->onRender[] = function (Datagrid $datagrid): void {
	if (isset($datagrid['form']['actions']['action'])) {
		/** @var \Nette\Forms\Controls\SelectBox $selectBox */
		$selectBox = $datagrid['form']['actions']['action'];
		$selectBox->setPrompt('globalActions.action.prompt');
	}

	if (isset($datagrid['form']['actions']['process'])) {
		/** @var \Nette\Forms\Controls\SubmitButton $selectBox */
		$selectBox = $datagrid['form']['actions']['process'];
		$selectBox->caption = 'globalActions.process.label';
	}
}

To

$datagrid->setGlobalActionSelectPrompt('globalActions.action.prompt');
$datagrid->setGlobalActionProcessLabel('globalActions.process.label');

Or some better solution ?

@slischka slischka self-assigned this Mar 6, 2019
@slischka slischka force-pushed the slischka branch 2 times, most recently from 9fb0c9f to 6674a4a Compare March 6, 2019 17:51
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

Successfully merging this pull request may close these issues.

2 participants