-
Notifications
You must be signed in to change notification settings - Fork 56
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
More control of CRUD interface elements #669
Conversation
i saw a few small things we might change. But in general there are two things which we should discuss:
|
I often need to add some text (instructions) or data (statistics, for example) before CRUD table.
|
i would suggest do have a property on the base ngrest controller: class MySuperController extends \base\Controller
{
public $crudInterfaceConfig = [
'class' => DefaultCrudInterfaceConfig::class,
'intro' => 'foo bar',
'title' => 'my title',
];
public $modelClass = '....';
} then you can pass either just the config or direct call This way we can have a base CRUD interface config class which covers all those settings and options. For your use case with extra rendering you could then also override a certain property in actionIndex():
Of course this is only required when you want to use When we have decoupled all the possible crud interface config settings we could provider out of the box "dense"-mode like follows:
then you could just pass that dense config as default in your controller:
Do you know what i mean? Inside of if ($interface->showSearch) {} @Antikon if you like i can prepare the mechanics and you fill it with "life" afterwards (adding the options, adding the if/else, adding the modes f.e) |
@nadar, I agree with your suggestions, but I see no need for an 'intro' property. Someone may need to put something after the table, or add something more complex than a simple template before (see #491, for example). Or do you have some more substantial objection to Anyway, your help with the mechanics would be greatly appreciated. |
…into luyadev-master
I am going to close this issue because:
If you think this is still important or there are more/new informations. Please reopen the issue and let us know. If this is a problem or a feature you like to discuss, join our discussion: LUYA discussions. We try to keep our issue tracker as clean as possible in order to focus on active issues. |
What are you changing/introducing
Added an
$interface
parameter toactionIndex()
method toluya\admin\ngrest\base\Controller
, so one can control which interface elements are shown and which are hidden.Also added more complex logic for displaying the search field and the grouping and filter drop-down lists on wide screens:
Since the methods
getInterfaceSettings()
andsetInterfaceSettings()
have been declared in theRenderCrudInterface
interface, this can break custom CRUD renderers which implementsRenderCrudInterface
. Therefore, this PR can be postponed until version 5.0.0.What is the reason for changing/introducing
Allow to customize CRUD interface in the controller.
QA