Bad luck with repeating group changing element's names

Shure, I have this element cargo___cargo_details. When set to 8 (Umzugsgut) it should show the
groups 104, 94, 95, 96
and the tabs 2, 3, 4, 5, 6
and it should hide the
group 72
and the tab 2.

When not set 8 it should work vice versa. All this should be done on load and on change.

I have tried to do this via js code in the element itself and by putting it in files here

150401/components/com_fabrik/js/details_19.js
150401/components/com_fabrik/js/form_19.js

but it didn't help.

Now if you load the details for an element like this (cargo___cargo_details = 8)

150401/index.php/ladung/details/19/197

all elements in the concerning groups are hidden!

EDIT:
funnily it works for an element like this (cargo___cargo_details <> 8)

/150401/index.php/ladung/details/19/195
 
Last edited:
OK, I wasn't sure if you were talking about the issue with moving elements between groups or the tab hiding.

I'll take a look when I get to a computer.


Sent from my HTC One using Tapatalk
 
shure!

this is the JS code for hiding and showing some groups and tabs if you use bootstrap_tabs template for lists.

there you go:

Code:
function HideDetailsReally () {

var form = Fabrik.getBlock('form_19');
if (!form) {
  form = Fabrik.getBlock('details_19');
}

if (form.options.editable) {

  if (jQuery('#cargo___cargo_details').val() === '8') {
    jQuery('#group104').show().removeClass('fabrikHide');
    jQuery('#group94').show().removeClass('fabrikHide');
    jQuery('#group95').show().removeClass('fabrikHide');
    jQuery('#group96').show().removeClass('fabrikHide');
    jQuery('#group72').hide().addClass('fabrikHide');
  } else {
    jQuery('#group104').hide().addClass('fabrikHide');
    jQuery('#group94').hide().addClass('fabrikHide');
    jQuery('#group95').hide().addClass('fabrikHide');
    jQuery('#group96').hide().addClass('fabrikHide');
    jQuery('#group72').show().removeClass('fabrikHide');
  }

}else{

  if (JSON.parse(form.formElements.get('cargo___cargo_details').getValue()) === 8) {
    form.hideGroupTab('72');
    form.showGroupTab('94');
    form.showGroupTab('95');
    form.showGroupTab('96');
    form.showGroupTab('104');
  } else {
    form.showGroupTab('72');
    form.hideGroupTab('94');
    form.hideGroupTab('95');
    form.hideGroupTab('96');
    form.hideGroupTab('104');
  }
}
}
 
We are in need of some funding.
More details.

Thank you.
Back
Top