ada form->color and datatable row action icon no-wrap fixed

This commit is contained in:
2025-12-25 09:22:33 +07:00
parent 4a0a4afe49
commit 013715745b
2 changed files with 26 additions and 18 deletions
+1 -1
View File
@@ -811,7 +811,7 @@ Request.JSONF = function(options){
_tbtn1 += '<div><input class="form-check-input" type="checkbox" id="'+ChkField+'_cbox_'+val[0].checkbox.field+'" value="'+val[0].checkbox.value+'"></div>'; _tbtn1 += '<div><input class="form-check-input" type="checkbox" id="'+ChkField+'_cbox_'+val[0].checkbox.field+'" value="'+val[0].checkbox.value+'"></div>';
} }
} }
strBody += '<td class="">'+_tbtn1+_tbtn2+'</td></tr>'; strBody += '<td class="'+(ini.config.txtbutton===true?'':'text-nowrap')+'">'+_tbtn1+_tbtn2+'</td></tr>';
}); });
strBody += '</tbody>'; strBody += '</tbody>';
+25 -17
View File
@@ -6,9 +6,9 @@
Desc. : v3 - Form Generator (jQuery & Bootstrap) Desc. : v3 - Form Generator (jQuery & Bootstrap)
Created By : Siau Pheng ([email protected]). Created By : Siau Pheng ([email protected]).
Created Date : February 27th, 2008. Created Date : February 27th, 2008.
Last Modified : January 19th, 2024. Last Modified : December 9th, 2025.
(c) 2008 - 2024, 3FONIA Software; WWW.3FONIA.COM. (c) 2008 - 2025, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/ *******************************************************************/
@@ -142,28 +142,27 @@ final class Form {
$_enab = ($benable==true) ? "" : ' disabled=true'; $_enab = ($benable==true) ? "" : ' disabled=true';
$_req = ($breq==true) ? " required=true" : ""; $_req = ($breq==true) ? " required=true" : "";
$_change = ' onchange="this.value=(this.checked)?\''.$avalue[0].'\':\''.$avalue[1].'\';'.($tchange==null?'':$tchange).'"'; $_change = ' onchange="this.value=(this.checked)?\''.$avalue[0].'\':\''.$avalue[1].'\';'.($tchange==null?'':$tchange).'"';
$tout = '<div class="form-check form-check-inline mr-1"><input type="checkbox" class="form-check-input" id="'.$tfield.'" name="'.$tfield.'" value="'.($bhasil?$avalue[1]:$avalue[0]).'"'.$_enab.$_change.$_req; $tout = '<input type="checkbox" class="form-check-input" id="'.$tfield.'" name="'.$tfield.'" value="'.($bhasil?$avalue[1]:$avalue[0]).'"'.$_enab.$_change.$_req;
$tout .= ($bhasil==false) ? ' checked="checked"' : ''; $tout .= ($bhasil==false) ? ' checked="checked"' : '';
$tout .= '>';
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
return $tout;
}
public function switch($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $aarr=array(), $thelp="", $tchange=null) {
$_key = array_keys($aarr); $_val = array_values($aarr);
$_enab = ($benable==true) ? "" : ' disabled=true';
$_req = ($breq==true) ? " required=true" : "";
$_change = ($tchange==null) ? ' onchange="this.value=(this.checked)?\''.$_key[0].'\':\''.$_key[1].'\';"' : ' onchange="this.value=(this.checked)?\''.$_key[0].'\':\''.$_key[1].'\';'.$tchange.'"';
$tout = '<div class="form-check form-switch"><input class="form-check-input me-0" id="'.$tfield.'" name="'.$tfield.'" type="checkbox" role="switch" value="'.$tvalue.'"'.$_enab.$_change.$_req;
$tout .= ($_key[0] == $tvalue) ? ' checked="checked"' : '';
$tout .= '></div>'; $tout .= '></div>';
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout); $this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
return $tout; return $tout;
} }
//todo: perlu test lagi !!
public function switch_sq($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $aarr=array(), $thelp="", $tchange=null) {
$_key = array_keys($aarr); $_val = array_values($aarr);
$_enab = ($benable==true) ? "" : ' disabled=true';
$_req = ($breq==true) ? " required=true" : "";
$_change = ($tchange==null) ? ' onchange="this.value=(this.checked)?\''.$_key[0].'\':\''.$_key[1].'\';"' : ' onchange="this.value=(this.checked)?\''.$_key[0].'\':\''.$_key[1].'\';'.$tchange.'"';
$tout = '<div class="form-check form-switch form-switch-lg"><input class="form-check-input me-0" id="'.$tfield.'" name="'.$tfield.'" type="checkbox" value="'.$tvalue.'"'.$_enab.$_change.$_req;
$tout .= ($_key[0] == $tvalue) ? ' checked="checked"' : '';
$tout .= '><label class="form-check-label fw-semibold small" for="'.$tfield.'">&nbsp;</label></div>';
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
return $tout;
}
//todo: belum diupgrade !! //todo: belum diupgrade !!
public function form_group_cbox($tfield, $tkey=null, $tclass=null, $ttable=null, $afield=null, $ncol=2) { public function group_cbox($tfield, $tkey=null, $tclass=null, $ttable=null, $afield=null, $ncol=2) {
if ($ttable==null) return; if ($ttable==null) return;
$avalue = explode(",", $tkey); $avalue = explode(",", $tkey);
$afield = ($afield==null) ? array("ID", "Nama") : $afield; $afield = ($afield==null) ? array("ID", "Nama") : $afield;
@@ -260,6 +259,15 @@ final class Form {
return $tout; return $tout;
} }
public function color($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $thelp="", $tchange=null) {
$_enab = ($benable==true) ? "" : ' disabled=true';
$_req = ($breq==true) ? " required=true" : "";
$_change = ($tchange==null) ? '' : ' onchange="'.$tchange.'"';
$tout = '<input type="color" class="form-control form-control-color" id="'.$tfield.'" name="'.$tfield.'" value="'.$tvalue.'"'.$_enab.$_change.$_req.' />';
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
return $tout;
}
public function hidden($tfield, $tvalue="", $tclass="text") { public function hidden($tfield, $tvalue="", $tclass="text") {
$tout = '<input type="hidden" id="'.$tfield.'" value="'.$tvalue.'" class="'.$tclass.'" />'; $tout = '<input type="hidden" id="'.$tfield.'" value="'.$tvalue.'" class="'.$tclass.'" />';
$this->__ahide[$tfield] = $tout; $this->__ahide[$tfield] = $tout;