radio button break layout tab

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
soewandi
Veteran Member
Posts: 34
Joined: 2019-11-20 14:00

radio button break layout tab

Post by soewandi » 2024-10-27 14:10

@Ahmed, FYI: Layout Tab in Detail View break.
Problem: When input field type = ‘radio button’ and user group permission set only to ‘View’, I’ve experienced Layout Tab breaks in Detail View.
I insert code for Layout Tab in hooks/tablename.php on function tablename_dv.
But if user group permission set to ‘Insert’, ‘Edit’, and ‘View’, Layout Tab appears as expected.
I hope you can investigate, is it a bug or not. Thanks.

My regards,
Soewandi

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

Re: radio button break layout tab

Post by jsetzer » 2024-10-27 14:16

(screenshot would help understanding this issue)
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.14 Revision 1665 + all AppGini Helper tools

soewandi
Veteran Member
Posts: 34
Joined: 2019-11-20 14:00

Re: radio button break layout tab

Post by soewandi » 2024-10-27 15:45

Thanks Mr Jan. My code to make layout tab:

Code: Select all

function databaru_dv($selectedID, $memberInfo, &$html, &$args) {
	/* if this is the print preview, don't modify the detail view */
		if(isset($_REQUEST['dvprint_x'])) return;
			ob_start(); ?>
			<div id="form-tabs">
				<ul class="nav nav-tabs">
					<li class="active"><a href="#marital" data-toggle="tab">Data Marital</a></li>
					<li><a href="#kontak" data-toggle="tab">Data Kontak</a></li>
				</ul>
				<ul class="tab-content">
					<div class="tab-pane active form-horizontal" id="marital"></div>
					<div class="tab-pane form-horizontal" id="kontak"></div>
				</ul>
				</div>
				
		<style>
			#form-tabs .nav-tabs a{ display: block !important; }
		</style>
		
		<script>
			$j(function(){
			$j('#form-tabs').appendTo('#databaru_dv_form');
			/* fields to move to tab data marital */
			$j('#goldarah').parents('.form-group').appendTo('#marital');
			$j('#jenjang').parents('.form-group').appendTo('#marital');
			$j('#marital').parents('.form-group').appendTo('#marital');
			$j('#pasangan').parents('.form-group').appendTo('#marital');
			
			/* fields to move to data kontak tab */
			$j('#alamat').parents('.form-group').appendTo('#kontak');
			$j('#no').parents('.form-group').appendTo('#kontak');
			$j('#kota').parents('.form-group').appendTo('#kontak');
			$j('#kodepos').parents('.form-group').appendTo('#kontak');
			$j('#tlphp').parents('.form-group').appendTo('#kontak');
			$j('#tlprmh').parents('.form-group').appendTo('#kontak');
			$j('#tlpktr').parents('.form-group').appendTo('#kontak');
			$j('#email').parents('.form-group').appendTo('#kontak');
			
			})
		</script>
		<?php
			$tabs = ob_get_contents();
			ob_end_clean();
			$html .= $tabs;
	}
If I used option list type radio button. Fieldname: goldarah, jenjang, marital --> are not appear in marital tab
If I used option list type dropdown select, those fieldnames appear are appear in marital tab (as expected).

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1667
Joined: 2018-04-01 10:12

Re: radio button break layout tab

Post by pbottcher » 2024-10-30 07:04

Hi,

I believe Radio input is created differently in AppGini. So the usual $j('#FIELDNAME').parents('.form-group') will not work.

You can try

Code: Select all

$j('[for="FIELDNAME"]').parents('.form-group')
instead.
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.

soewandi
Veteran Member
Posts: 34
Joined: 2019-11-20 14:00

Re: radio button break layout tab

Post by soewandi » 2024-10-31 12:43

@pbottcher, thank you for your help. I've tried your suggestion but still not success to place the radio button field in the TAB. May be this image can help.
Image

And the code as

Code: Select all

function databaru_dv($selectedID, $memberInfo, &$html, &$args) {
	/* if this is the print preview, don't modify the detail view */
		if(isset($_REQUEST['dvprint_x'])) return;
			ob_start(); ?>
			<div id="form-tabs">
				<ul class="nav nav-tabs">
					<li class="active"><a href="#marital" data-toggle="tab">Data Marital</a></li>
					<li><a href="#kontak" data-toggle="tab">Data Kontak</a></li>
				</ul>
				<ul class="tab-content">
					<div class="tab-pane active form-horizontal" id="marital"></div>
					<div class="tab-pane form-horizontal" id="kontak"></div>
				</ul>
				</div>
				
		<style>
			#form-tabs .nav-tabs a{ display: block !important; }
		</style>
		
		<script>
			$j(function(){
			$j('#form-tabs').appendTo('#databaru_dv_form');
			/* fields to move to tab data marital */
			$j('[for="goldarah"]').parents('.form-group').appendTo('#marital');
			$j('[for="jenjang"]').parents('.form-group').appendTo('#marital');
			$j('[for="marital"]').parents('.form-group').appendTo('#marital');
			$j('#pasangan').parents('.form-group').appendTo('#marital');
			
			/* fields to move to data kontak tab */
			$j('#alamat').parents('.form-group').appendTo('#kontak');
			$j('#no').parents('.form-group').appendTo('#kontak');
			$j('#kota').parents('.form-group').appendTo('#kontak');			
			})
		</script>
		<?php
			$tabs = ob_get_contents();
			ob_end_clean();
			$html .= $tabs;
	}
My regards,
Soewandi

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1667
Joined: 2018-04-01 10:12

Re: radio button break layout tab

Post by pbottcher » 2024-10-31 14:45

Hi Soewandi,

which version of Appgini are you using?

You can try

$j('label.contains("THELABELOFTHEFIELD")').parents('.form-group')

e.g.

Code: Select all

$j('label.contains("Gol Darah")').parents('.form-group')
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.

soewandi
Veteran Member
Posts: 34
Joined: 2019-11-20 14:00

Re: radio button break layout tab

Post by soewandi » 2024-10-31 17:35

Hello pbottcher, I used AG Ver 24.17 (last version). With your new code:

Code: Select all

$j('label.contains("Gol Darah")').parents('.form-group')
still didn't get the right results.
Anyway I thank you for your effort to help me.

My regards,
Soewandi

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1667
Joined: 2018-04-01 10:12

Re: radio button break layout tab

Post by pbottcher » 2024-10-31 20:32

Hi Soewandi,

there is a typo in my code.

Please use

Code: Select all

$j('label:contains("Gol Darah")').parents('.form-group')
instead.
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.

soewandi
Veteran Member
Posts: 34
Joined: 2019-11-20 14:00

Re: radio button break layout tab

Post by soewandi » 2024-11-01 04:42

Hello pbottcher, your new code

Code: Select all

$j('label:contains("Marital")').parents('.form-group')
still didn't work.
Image

Code: Select all

function databaru_dv($selectedID, $memberInfo, &$html, &$args) {
	/* if this is the print preview, don't modify the detail view */
		if(isset($_REQUEST['dvprint_x'])) return;
			ob_start(); ?>
			<div id="form-tabs">
				<ul class="nav nav-tabs">
					<li class="active"><a href="#marital" data-toggle="tab">Data Marital</a></li>
					<li><a href="#kontak" data-toggle="tab">Data Kontak</a></li>
				</ul>
				<ul class="tab-content">
					<div class="tab-pane active form-horizontal" id="marital"></div>
					<div class="tab-pane form-horizontal" id="kontak"></div>
				</ul>
				</div>
				
		<style>
			#form-tabs .nav-tabs a{ display: block !important; }
		</style>
		
		<script>
			$j(function(){
			$j('#form-tabs').appendTo('#databaru_dv_form');
			/* fields to move to tab data marital */
			$j('label:contains("Marital")').parents('.form-group').appendTo('#marital');
			$j('#pasangan').parents('.form-group').appendTo('#marital');
			
			/* fields to move to data kontak tab */
			$j('#alamat').parents('.form-group').appendTo('#kontak');
			$j('#no').parents('.form-group').appendTo('#kontak');
			$j('#kota').parents('.form-group').appendTo('#kontak');			
			})
		</script>
		<?php
			$tabs = ob_get_contents();
			ob_end_clean();
			$html .= $tabs;
	}
To Mr. Jsetzer and Mr. Pbottcher, I apologize about my English. I'll refresh my problem: fieldname defines as 'options list' can not display in Layout Tab. I insert code for Layout Tab in hooks/tablename.php on function tablename_dv.
Is this a bug or not? Many thanks for all your help.

Best regards,
Soewandi

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1667
Joined: 2018-04-01 10:12

Re: radio button break layout tab

Post by pbottcher » 2024-11-01 11:43

Hi Soewandi,

actuall it is not a bug, as you add your own code, you need to know how to add the code. Different elements are represented in different ways, therefor there is not one solution to cover all possibilites.

Back to you problem.
You may also try

Code: Select all

$j('.form-group.TABLENAME-FIELDNAME').appendTo('#marital');
or

Code: Select all

$j('[name="FIELDNAME"]').parents('.form-group').appendTo('#marital');
or

Code: Select all

$j('#FIELDNAME0').parents('.form-group').appendTo('#marital');
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.

soewandi
Veteran Member
Posts: 34
Joined: 2019-11-20 14:00

Re: radio button break layout tab

Post by soewandi » 2024-11-03 15:35

Hi pbottcher,
Among your code suggestion, at last this code:

Code: Select all

$j('[name="FIELDNAME"]').parents('.form-group').appendTo('#marital');
Working as intended. That “fieldname” place in Marital Tab as expected. Many thanks for your patient and valuable time to guide me.
Best regards,
Soewandi

Post Reply