FoxInCloud
switch checkbox
Hi Thierry,
It might be nice to integrate this new graphical representation of checkboxes (Bootstrap 5.1) ...
So far, I have very easily created a class from my base class, adding this code:
wcHTMLgen()
IF VARTYPE (toHTMLgen) = Cobjet
toHTMLgen.cScriptJSAdd(TEXTMERGE ([jQuery('#<<THIS.wcID>>_div').removeClass().addClass("form-check form-switch");]))
ENDIF
And it works without any other addition!
Cool, thanks a lot for the feedback.
Another nice surprise (from Bootstrap) is that the HTML and CSS class markup is the same regardless whether the checkbox is rendered classically or as a switch.
Please note you can simply add the switch-specific Bootstrap class without removing first all classes:
procedure wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML && {en} doc in Parent Code
…
IF VARTYPE (toHTMLgen) = Cobjet
toHTMLgen.cScriptJSAdd(TEXTMERGE ([jQuery('#<<THIS.wcID>>_div').addClass("form-switch");]))
ENDIF
…