FoxInCloud
checkbox wBScolAlign
Gravatar is a globally recognized avatar based on your email address. checkbox wBScolAlign
  Vincent H.
  All
  May 20, 2022 @ 02:15am

Hi Thierry,

When you want to align a check box to the right, only the label is aligned, not the check mark.

The "float" statement should apply to the parent.

Thanks in advance

Gravatar is a globally recognized avatar based on your email address. re: checkbox wBScolAlign
  FoxInCloud Support - Thierry N.
  Vincent H.
  May 20, 2022 @ 02:26am

Hi Vincent,

These additional classes fix the issue:

<div class="form-check">
  <input class="form-check-input float-end" type="checkbox" …>
  <label class="form-check-label float-end me-4" …>
Gravatar is a globally recognized avatar based on your email address. re: checkbox wBScolAlign
  Vincent H.
  FoxInCloud Support - Thierry N.
  May 20, 2022 @ 02:45am

I had this code (witch works)

wcHTMLgen()
DODEFAULT (toHTMLgen, tlInnerHTML)
IF VARTYPE (m.toHTMLgen) = Cobjet
   toHTMLgen.CSScustomAdd(TEXTMERGE ([#<<THIS.wcID>>_div {float: right;}]))
ENDIF

Gravatar is a globally recognized avatar based on your email address. re: checkbox wBScolAlign
  FoxInCloud Support - Thierry N.
  Vincent H.
  May 20, 2022 @ 03:00am

Vincent,

Even if it may sound frustrating, adding CSS rules is no longer the way to go: you should always add CSS classes provided by Bootstrap, more efficient and responsive.

procedure wcHMTLgen
lparameters toHTMLgen, tlInnerHTML

local result, cScript  

result = DODEFAULT (toHTMLgen, tlInnerHTML)

IF VARTYPE (m.toHTMLgen) = Cobjet
 text to cScript textmerge noshow flags 1
var $Div = jQuery('#<<this.wcID>>').parent();
$Div.find('input').addClass('float-end');
$Div.find('label').addClass('float-end me-4');
 endtext
 toHTMLgen.cScriptJSadd(m.cScript)
ENDIF

return m.result
Gravatar is a globally recognized avatar based on your email address. re: checkbox wBScolAlign
  Vincent H.
  FoxInCloud Support - Thierry N.
  May 20, 2022 @ 03:05am

Thanks Thierry.

FiC always at the forefront of progress 😃

Gravatar is a globally recognized avatar based on your email address. re: checkbox wBScolAlign
  Vincent H.
  Vincent H.
  May 20, 2022 @ 03:14am

But ...

Gravatar is a globally recognized avatar based on your email address. re: checkbox wBScolAlign
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jul 8, 2022 @ 08:31am

Hi Thierry,

I return to the subject.

Finally, this simple code seems to work well.

checkBox.wcHTMLgen()

LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML && {en} doc in Parent Code {fr} doc dans le code parent
DODEFAULT (toHTMLgen, tlInnerHTML)
IF VARTYPE (m.toHTMLgen) = "O" .AND. THIS.wBScolAlign = "R"
   toHTMLgen.cScriptJSadd(TEXTMERGE ([jQuery('#<<THIS.wcID>>').parent().addClass("float-end");]))
ENDIF

If it works for you, could you embed it in all container-like controls to react to wBScolAlign="R" ?

Thank you for your attention

Gravatar is a globally recognized avatar based on your email address. re: checkbox wBScolAlign
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jul 9, 2022 @ 10:05am

Hi Vincent,

Just to be sure, can you share a screenshot of the modified HTML DOM from the ‘Elements’ tab in the browser dev. tools?

TIA

Gravatar is a globally recognized avatar based on your email address. re: checkbox wBScolAlign
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jul 9, 2022 @ 11:38pm

Of course ... This is the chekBox "Liquidée" named "decesliq"

Gravatar is a globally recognized avatar based on your email address. re: checkbox wBScolAlign
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jul 12, 2022 @ 06:45am

Yes, but not necessarily. There will always be the problem of alignment, right ?

Gravatar is a globally recognized avatar based on your email address. re: checkbox wBScolAlign
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jul 13, 2022 @ 05:57am

If in VFP the checkbox is at the right of the label, we can add the .form-check-reverse class which automatically justifies to the right.

Then .wBScolAlign is no longer useful.

© 1996-2024