Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by sleidia on Apr 27, 2009 07:56
open dhtmlx forum
dhtmlxCombo and wordwrap


Hello,

I'm highly interested in purchasing several licenses for my clients but
the documentation doesn't say whether it's possible to enable wordwrap
with linebreaks in any of your combobox solutions.

In fact, for multingual sites, it often happens that the text for a different
language is wider than the combo's width. I need to find comboboxes that can
display a single option on more than one line of text, but on a single and unique value.

Thanks for letting me know if your scripts can do that ... or could do that for some extra fee.

Best regards.
Answer posted by Support on Apr 27, 2009 10:09
>>with linebreaks in any of your combobox solutions.
The combo option accepts the HTML formated string as a label, so it possible to include any HTML elements in option, include forced newlines.

combo.addOption("value","label <br/> label")

>>display a single option on more than one line of text
It is possible , by using HTML tags inside label, the scripts has native support for such functionality and need not any modification.
Answer posted by sleidia on Apr 27, 2009 10:26
Sorry but I think there was a misunderstanding or I failed to explain well enough what I need.

I don't want to add linebreaks by myself.

I want a combobox to automatically do wordwrap when the text exceeds the combobox width.
The wordwrap would make it look like there is a linebreak, but this should be done automatically.

Or, is it possible to have combo.addOption("value","<span class=\"myclass\">label</span>") and
have word-wrap: break-word as the CSS style for myclass?

Thanks again for letting me know if any of these is possible.


Answer posted by Alex (support) on Apr 29, 2009 01:34

Hello,

the latest combo version does wordwrap automatically.

If the autowidth is enabled, the width of the option list is increased/decreased automatically:

http://dhtmlx.com/docs/products/dhtmlxCombo/samples/options/combo_auto_size.html

 

Answer posted on Apr 29, 2009 03:32

Hi Alex,

I'm sorry but wordwrap and autowidth are two different things if I understand well.

It's wordwrap that I need for my clients because the combos width must be fixed in order to avoid common placement problems in the layout.
Lets say I have a combo with width:200px but the text for the labels is wider than that .
I simply need the text to fill the available space by adding extra lines and without changing the combo's width.

Is there a way to achieve this?





Answer posted by Alex (support) on Apr 29, 2009 08:25

Hello,

>> I simply need the text to fill the available space by adding extra lines and without changing the combo's width.

In the latest combo version this mode is available by default.