Almost all items have an ID. That is easy to make adjustments in tablename.php or tablename_dv.js.
As described in the Udemy course, I use tabs and the horizontal layout. That works perfectly. See the example below.
For users with read-only permission, it looks like this:
The radio buttons are not displayed properly. The cause is the absence of an ID.
Below the code from the tablename-dml.php script. The first line is the original code, the second the custom code, with id.
// $jsReadOnly .= "\tjQuery('input[name=rms_mv]').parent().html('<div class=\"form-control-static\">' + jQuery('input[name=rms_mv]:checked').next().text() + '</div>')\n";
$jsReadOnly .= "\tjQuery('input[name=rms_mv]').parent().html('<div class=\"form-control-static\" id=\"rms_mv\">' + jQuery('input[name=rms_mv]:checked').next().text() + '</div>')\n";
After this adjustment, the radio button is displayed properly:
Question: is there perhaps another way to solve this problem?
After the generation, the changes are gone.
error showing radio button when read-only
error showing radio button when read-only
Bert
I am using Appgini 5.75
I am using Appgini 5.75
Re: error showing radio button when read-only
Hi,
how did you put your fields in the tabs? Especially for the radio button.
how did you put your fields in the tabs? Especially for the radio button.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: error showing radio button when read-only
In the normal situation where users can update, the radio buttons have an id in the generated template and dml script.
See the code below
/* change the layout only if this is not the print preview */
if(!isset($_REQUEST['dvprint_x'])) {
ob_start(); ?>
// creating tabs
<div id="form-tabs">
<ul class="nav nav-tabs">
<li class="active"><a href="#relatieadres" data-toggle="tab">Relatieadres</a></li>
<li><a href="#postbusadres" data-toggle="tab">Postbus</a></li>
<li><a href="#factuuradres" data-toggle="tab">Factuuradres</a></li>
</ul>
<ul class="tab-content">
<div class="tab-pane form-inline active" id="relatieadres"></div>
<div class="tab-pane form-inline" id="postbusadres"></div>
<div class="tab-pane form-inline" id="factuuradres"></div>
</ul>
</div>
// define fields for each tab in order as they are shown
<script>
$j(function(){
$j('#form-tabs').appendTo('#adm_relatie_mutaties_dv_form');
/* fields to move to the Relatieadres tab */
$j('#rms_id').parents('.form-group').appendTo('#relatieadres');
// ......
$j('#rms_org_mv').parents('.form-group').appendTo('#relatieadres');
// radio buttons: each choice has his own id
$j('#rms_mv0').parents('.form-group').appendTo('#relatieadres');
$j('#rms_mv1').parents('.form-group').appendTo('#relatieadres');
$j('#rms_mv2').parents('.form-group').appendTo('#relatieadres');
// for read-only form, change id in table_name_dml.php
$j('#rms_mv').parents('.form-group').appendTo('#relatieadres');
.......
//
/* fields to move to the Postbus tab */
$j('#rms_org_postbus').parents('.form-group').appendTo('#postbusadres');
$j('#rms_postbus').parents('.form-group').appendTo('#postbusadres');
//
/* fields to move to the Factuuradres tab */
$j('#rms_org_naam_f').parents('.form-group').appendTo('#factuuradres');
$j('#rms_naam_f').parents('.form-group').appendTo('#factuuradres');
// .......
/* Fix for a bug with lookup drop-downs and date fields to set their correct width */
setInterval(function() {
$j('.select2-container')
.parents('.form-control-static')
.removeClass('form-control-static');
$j('table.form-control-static').removeClass('form-control-static');
}, 1000);
/* 5.70: Fix for a bug with lookup drop-downs to set their correct width */
$j('.form-inline .form-control-static').addClass('option-list').css({'display': 'unset'});
})
</script>
// define two columns
<style>
#form-tabs .nav-tabs a { display: block !important; }
.tab-content { padding-top: 3em; }
@media (min-width: 768px) {
.form-inline .form-group {
width: 48%;
margin-bottom: 0.75em;
vertical-align: top;
}
}
.form-inline .form-control {
width: 100% !important;
}
</style>
<?php
$html .= ob_get_clean();
}
See the code below
/* change the layout only if this is not the print preview */
if(!isset($_REQUEST['dvprint_x'])) {
ob_start(); ?>
// creating tabs
<div id="form-tabs">
<ul class="nav nav-tabs">
<li class="active"><a href="#relatieadres" data-toggle="tab">Relatieadres</a></li>
<li><a href="#postbusadres" data-toggle="tab">Postbus</a></li>
<li><a href="#factuuradres" data-toggle="tab">Factuuradres</a></li>
</ul>
<ul class="tab-content">
<div class="tab-pane form-inline active" id="relatieadres"></div>
<div class="tab-pane form-inline" id="postbusadres"></div>
<div class="tab-pane form-inline" id="factuuradres"></div>
</ul>
</div>
// define fields for each tab in order as they are shown
<script>
$j(function(){
$j('#form-tabs').appendTo('#adm_relatie_mutaties_dv_form');
/* fields to move to the Relatieadres tab */
$j('#rms_id').parents('.form-group').appendTo('#relatieadres');
// ......
$j('#rms_org_mv').parents('.form-group').appendTo('#relatieadres');
// radio buttons: each choice has his own id
$j('#rms_mv0').parents('.form-group').appendTo('#relatieadres');
$j('#rms_mv1').parents('.form-group').appendTo('#relatieadres');
$j('#rms_mv2').parents('.form-group').appendTo('#relatieadres');
// for read-only form, change id in table_name_dml.php
$j('#rms_mv').parents('.form-group').appendTo('#relatieadres');
.......
//
/* fields to move to the Postbus tab */
$j('#rms_org_postbus').parents('.form-group').appendTo('#postbusadres');
$j('#rms_postbus').parents('.form-group').appendTo('#postbusadres');
//
/* fields to move to the Factuuradres tab */
$j('#rms_org_naam_f').parents('.form-group').appendTo('#factuuradres');
$j('#rms_naam_f').parents('.form-group').appendTo('#factuuradres');
// .......
/* Fix for a bug with lookup drop-downs and date fields to set their correct width */
setInterval(function() {
$j('.select2-container')
.parents('.form-control-static')
.removeClass('form-control-static');
$j('table.form-control-static').removeClass('form-control-static');
}, 1000);
/* 5.70: Fix for a bug with lookup drop-downs to set their correct width */
$j('.form-inline .form-control-static').addClass('option-list').css({'display': 'unset'});
})
</script>
// define two columns
<style>
#form-tabs .nav-tabs a { display: block !important; }
.tab-content { padding-top: 3em; }
@media (min-width: 768px) {
.form-inline .form-group {
width: 48%;
margin-bottom: 0.75em;
vertical-align: top;
}
}
.form-inline .form-control {
width: 100% !important;
}
</style>
<?php
$html .= ob_get_clean();
}
Bert
I am using Appgini 5.75
I am using Appgini 5.75
Re: error showing radio button when read-only
Hi,
maybe you can try to move the complete div (for the radio buttons) instead of moving each one by one.
Try
$j("label[for='##RADIOBUTTONLABEL##']").parents('.form-group').appendTo('#relatieadres');
maybe you can try to move the complete div (for the radio buttons) instead of moving each one by one.
Try
$j("label[for='##RADIOBUTTONLABEL##']").parents('.form-group').appendTo('#relatieadres');
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: error showing radio button when read-only
This sugestion does not work, neither for the normal nor for the read-only situation. See screenprints + code below:
When users can update: When read only (with added Id in tablename-dml.php)
When users can update: When read only (with added Id in tablename-dml.php)
Bert
I am using Appgini 5.75
I am using Appgini 5.75
Re: error showing radio button when read-only
Hi,
what was the result?
Can you post the script to change the layout?
what was the result?
Can you post the script to change the layout?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: error showing radio button when read-only
This is the changed code in table_name.php:
You see the result in previous post: radio button M/V not in the tab, but in the 'header'.Bert
I am using Appgini 5.75
I am using Appgini 5.75
Re: error showing radio button when read-only
Hi,
you need to replace the ##RADIOBUTTONLABEL## with your label text.
As I see from your screenshot it should be in your case:
$j("label[for='rms_mv']").parents('.form-group').appendTo('#relatieadres');
Can you try this
you need to replace the ##RADIOBUTTONLABEL## with your label text.
As I see from your screenshot it should be in your case:
$j("label[for='rms_mv']").parents('.form-group').appendTo('#relatieadres');
Can you try this
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: error showing radio button when read-only
Yes, this works.
Thank you very much!
Thank you very much!
Bert
I am using Appgini 5.75
I am using Appgini 5.75