Sort fields in Admin view #43
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#43
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When editing an Admin View, it would be nice that after the first save, when we go to the fields section (where we can add/remove fields) they would appear ordered by "Tab" then "Order in Edit".
That would make it MUCH easier to make any changes to add /remove/ edit fields in a view.
Hmmm if you write the JavaScript of it I will add it 👍
This could probably be done with an "ORDER BY" clause in the code that gets the fields. I don't know how/where to access that part of the code.
I think this is only available to you since you have the source JCB component that was created on JCB.
Otherwise If you point me out the right path, I'll change it gladly. :)
Hmmm I don't think so.... the data is stored as a repeatable field so that mean in the DB it is in json. Best do it with JavaScript on the page...
Or reorder it on saving the data before giving it to the DB on line 1458 of the model on the var
$data['addfields']
do a var_dump to see the structure... or open the xml of the form to see the structure.Just post the code here that makes it work for you, then I will add it to the JCB UI on my system to test, and compile it into this repo... since you do realize the JCB is build with JCB right...
There you go, just add this after line 1458
Hi @Peeripapo I just found that this new sort could cause some headache...
So I am wondering if you can adapt your code to keep the left 1-2-3-4 and the right 1-2-3-4 field in order instead of the left-1 right-1 then left-2 right-2 to get mixed into get the order L-1,R-1,L-2,R-2,L-3,R-3,L-4,R-4 which basically makes it hard to follow the order of one area/column of fields. IT should be L-1,L-2,L-3,L-4,R-1,R-2,R-3,R-4 this way they are sorted in order but also combined in position.
Let me know 👍
Oh, it thought it was working that way. Gonna check into that.
Actually, it was just ordering by Tab, then by Field position. Should it be Tab, Position, Field then ?
I have views with many fields and many tabs, so best you setup some view like that, and then test your code until it produce the result of bundling the tab fields and then ordering the fields in the tabs by position and then in each position by order.
Ok, here's the fix just replace models/admin_view.php around line 1475:
with
Wasn't taking the alignment in consideration, not it is. Tested on Sermon admin view and seem to be working great. Of course you have to save the admin view for this to work, since it is implemented on save().
Added spacing, prettier code :)
You should close the issue after confirming its working ok, duh.
I've made a little change
IT works very well now 👍