Order of fields in form #718
Replies: 3 comments 7 replies
-
Hi there, if yours only problem is currently the order of fields, inputs, in create/update operation, I think there is no other answer then that, you can't order it anyhow :) The order of fields, which you create via.
Then the order of these fields, inputs, leads to the render in the final form in order, in which you wrote them down in that methods (create, update) which are in the CRUD controller. So every new field which you add to the create/update methods will be at the end of the form. There is a way, which I can think of, and that is to create blank fields, and then initialize them right later.. but I highly don't recommend it. I don't think that it is right approach, see below: (I wrote it just to show you the logic behind it)
I didn't test it, but from my experience what happened to me, is that, the Also order is then little bit different, when you use Tabs, .. or, we can say the same (see Backpack Fields API with anchor direct link to this problematics https://backpackforlaravel.com/docs/6.x/crud-fields#optional-tab-attribute-splits-forms-into-tabs). At the end I will just direct you to Backpack documentation which is really rich on examples, together with Backpack demo, links there: |
Beta Was this translation helpful? Give feedback.
-
Thank you for your reply. |
Beta Was this translation helpful? Give feedback.
-
We haven’t heard back from you in a while, so we’re closing this issue for now. If you still need assistance, please don’t hesitate to reopen the issue or create a new one. Thank you, and take care! Cheers. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have just started trying backpack and think it's fantastic!! The only issue I am finding (which may well be my fault) is as follows:
I have added a table based select in my DealerCrudController.php
CRUD::field('country_id')->type('select')->entity('country')->attribute('name')->model('App\Models\Country');
Problem - it appears as the first field in the forms, when I want it to appear last!
So my questions are:
Thanks in advance :)
Beta Was this translation helpful? Give feedback.
All reactions