DV, Order of groups?

This sub-forum is for discussing all topics related to AppGini Helper JavaScript Library, provided by bizzworxx as a third-party AppGini plugin.
Post Reply
User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1158
Joined: 2019-05-21 22:42
Location: Germany
Contact:

DV, Order of groups?

Post by onoehring » 2020-11-17 08:48

Hi Jan,

I created some groups, but they show up in a different order than I defined them. Is that normal? If yes, what is the order? Can I set the order myself?

Code: Select all

var dv = AppGiniHelper.DV;
dv.addGroup("grp_SettingsAttachments", "Anhänge", [...]);
dv.addGroup("grp_SettingsLocation", "Platzdefinition", [...]);
dv.addGroup("grp_SettingsJobliste", "Job-Liste", [...]);
dv.addGroup("grp_SettingsRest", "Diverses", [...]);
Looks like this:
grouporder.png
grouporder.png (2.25 KiB) Viewed 3025 times
Yes, I cleared the browser cache and reloaded the page (tried multiple times).

Olaf

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1814
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: DV, Order of groups?

Post by jsetzer » 2020-11-17 09:03

Hi Olaf,

that looks strange. I am going to have a look at this issue.

I don't think this will have a different effect, but anyway, can you please try the same using chaining technique like this:

Code: Select all

var dv = AppGiniHelper.DV
  .addGroup("grp_SettingsAttachments", "Anhänge", [...])
  .addGroup("grp_SettingsLocation", "Platzdefinition", [...])
  .addGroup("grp_SettingsJobliste", "Job-Liste", [...])
  .addGroup("grp_SettingsRest", "Diverses", [...])
  ;
Sorry for inconvenience!
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1158
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: DV, Order of groups?

Post by onoehring » 2020-11-17 09:09

Hi Jan,

no change with your suggestion.
I removed all ; in the end, expect the very latest which I placed on the new line as well. Also removed the dv. before all addGroup's.
OLaf

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1814
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: DV, Order of groups?

Post by jsetzer » 2020-11-17 09:16

Hi Olaf,

good news is:
I can reproduce this behaviour.

bad news is:
I can reproduce this behaviour

chrome_0sIAqpK2Qj.png
chrome_0sIAqpK2Qj.png (7.4 KiB) Viewed 3016 times

Gonna do some research today and hopefully find a workaround for now and a bugfix for next version.

Stay tuned!
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1158
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: DV, Order of groups?

Post by onoehring » 2020-11-17 09:26

Hi Jan,

great, that it's a reproducible behaviour. Take your time. And thank you already.
Olaf

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1814
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: DV, Order of groups?

Post by jsetzer » 2020-11-17 09:43

It seems to be related to read only fields:
As soon as I put a readonly field into a group, that group will be placed top. So I will have to do some research on this and see if something has changed with form-control-static recently.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1814
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: DV, Order of groups?

Post by jsetzer » 2020-11-17 10:26

Workaround for now

Move the groups using jQuery:

Code: Select all

$j("#grp_4").insertAfter("#grp_3");
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1158
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: DV, Order of groups?

Post by onoehring » 2020-11-17 10:30

Hi Jan,
thank you. For me it's on a settings page only at this time, so I will wait for the next version - where I am sure you will have it fixed.
Olaf

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1158
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: DV, Order of groups?

Post by onoehring » 2020-11-17 10:46

Hi Jan,

just dropped to my mind: In my case I do NOT have a read only value in the groups. I will drop you a screenshot in PM.

Olaf

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1814
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: DV, Order of groups?

Post by jsetzer » 2020-11-17 11:10

You are right, @Olaf, and my first guess was wrong: It has nothing to do with form-control-static, it seems.

Digging deeper, I remember the panels will be sorted in order of the fields. The position of the first field of a group decides about the placement of the panel.


Solution

You can change the order of the panels by changing the order of the fields in your model (in AppGini itself).


Workaround

For a more flexible positioning you can move panels to every other place using jQuery:

Code: Select all

$j("#grp_4").insertAfter("#grp_3");

Future release

I consider modifing the group placement algorithm to better reflect the sorting-order according to serial order of .addGroup()-commands in the javascript code. For backward-compatibility reasons this sorting behaviour should become configurable.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

Post Reply