Checkbox with Labeltext on the left side

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
NickHenig
New User
Posts: 8
Joined: Tue Sep 01, 2015 6:54 am
First Name: Nick
Last Name: Henig
Company Name: L.Stroetmann Gruppe
Phone: +492517182299
Address 1: Harkortstraße 30
City: Münster
State / Province: Outside Canada/USA
Zip / Postal Code: 48163
Country: Germany
Contact:

Checkbox with Labeltext on the left side

Post by NickHenig »

Hello,

I'm trying to create a Checkbox with the labeltext on the left side. Is that possible? I can't find an option for that.

Best regards
jwilliams
New User
Posts: 12
Joined: Mon Sep 21, 2015 11:45 am
First Name: Jada
Last Name: Williams
Company Name: Profound Logic
City: Dayton
State / Province: Ohio
Country: United States
Contact:

Re: Checkbox with Labeltext on the left side

Post by jwilliams »

Hi Nick, the easiest way to do this is to remove the label property from the Checkbox and add a label widget to the left side of the Checkbox.
NickHenig
New User
Posts: 8
Joined: Tue Sep 01, 2015 6:54 am
First Name: Nick
Last Name: Henig
Company Name: L.Stroetmann Gruppe
Phone: +492517182299
Address 1: Harkortstraße 30
City: Münster
State / Province: Outside Canada/USA
Zip / Postal Code: 48163
Country: Germany
Contact:

Re: Checkbox with Labeltext on the left side

Post by NickHenig »

Hi J,

yes, but then you can't click on the label text to toggle the checkbox. That's the problem.

regards
dieter
Experienced User
Posts: 122
Joined: Tue May 22, 2012 6:45 am
First Name: Dieter
Last Name: Schröder
Company Name: Ecclesia Holding GmbH
State / Province: Outside Canada/USA
Country: Germany
Contact:

Re: Checkbox with Labeltext on the left side

Post by dieter »

Hello Nick,
i know that my suggestion is not very smart, but it should work: Do so, as jwilliam said. Use an extra label at the left side of the checkbox. Then lay an onClick event on that label. In the OnClick event you can code a click on the checkbox.

Dieter
NickHenig
New User
Posts: 8
Joined: Tue Sep 01, 2015 6:54 am
First Name: Nick
Last Name: Henig
Company Name: L.Stroetmann Gruppe
Phone: +492517182299
Address 1: Harkortstraße 30
City: Münster
State / Province: Outside Canada/USA
Zip / Postal Code: 48163
Country: Germany
Contact:

Re: Checkbox with Labeltext on the left side

Post by NickHenig »

Hi Dieter,

thank you for your reply.

Yes, that is possible.
A nicer way to do it is to set the for attribute of the label to the Checkbox
like that: $("[id='label1']").next().children().first().attr('for', 'checkbox1');

But it's a lot of work to do that for every checkbox.
I'd prefer to have a custom widget or something like that. (the best solution would be to have a Lable align in the Profound Widget ;) )
dieter
Experienced User
Posts: 122
Joined: Tue May 22, 2012 6:45 am
First Name: Dieter
Last Name: Schröder
Company Name: Ecclesia Holding GmbH
State / Province: Outside Canada/USA
Country: Germany
Contact:

Re: Checkbox with Labeltext on the left side

Post by dieter »

Yes. Sometime i also wished to have the label on the left side. So a Profound attribute would be the best solution.

We use customized widgets only. But we did not create a really custom widget. We derive every widget, which is used. The derived widgets have attributes which give them a standard look and feel. So normally we don't have the necessity to change colors or fonts. But i am not sure if it is possible to add a java script to a derived widget.

Dieter
NickHenig
New User
Posts: 8
Joined: Tue Sep 01, 2015 6:54 am
First Name: Nick
Last Name: Henig
Company Name: L.Stroetmann Gruppe
Phone: +492517182299
Address 1: Harkortstraße 30
City: Münster
State / Province: Outside Canada/USA
Zip / Postal Code: 48163
Country: Germany
Contact:

Re: Checkbox with Labeltext on the left side

Post by NickHenig »

I found a solution, but ....

I add a css class to the checkboxes named rightCheck

and in the onLoad event I do:
$('.rightCheck').each(function() {
if (($(this).css('left')) < ($(this).next().css('left')))
{
$(this).next().css("left", $(this).css('left'));
var checkboxleft = parseInt($(this).css('left')) + parseInt($(this).next().css('width')) + 5;
$(this).css("left", checkboxleft + "px");
}
});

that works, but ...
I can't change the width of the checkbox field so the width depends on the length of the labletext.
Leading and Trailing Spaces are trimmed even if I toggle off:
Trim Leading Spaces
Trim Trailing Spaces ..... :(
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Checkbox with Labeltext on the left side

Post by Scott Klement »

If you'd like to request a feature in Profound UI, you can do so by sending an e-maill to support@profoundlogic.com

The spaces aren't trimmed from the checkbox label if you un-check the "trim blanks" options in the binding dialog, but they also do not show up on the display. This is because HTML/browsers don't normally show extra spaces, they act as if they are not there. For other dialogs, we replace blanks with non-breaking spaces (under the covers) to solve this problem, but it looks like that wasn't done with checkbox labels. This is another feature you could request from support@profoundlogic.com
NickHenig
New User
Posts: 8
Joined: Tue Sep 01, 2015 6:54 am
First Name: Nick
Last Name: Henig
Company Name: L.Stroetmann Gruppe
Phone: +492517182299
Address 1: Harkortstraße 30
City: Münster
State / Province: Outside Canada/USA
Zip / Postal Code: 48163
Country: Germany
Contact:

Re: Checkbox with Labeltext on the left side

Post by NickHenig »

thank you very much. I'll send an email regarding that issue :)
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests