EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: gordis gmbh on January 14, 2015, 09:27:11 AM



Title: text-alignment for number boxes
Post by: gordis gmbh on January 14, 2015, 09:27:11 AM
How can I style number boxes to align the numbers to right (e.g. text-align: right)?

The solution in following topic "http://www.jeasyui.com/forum/index.php?topic=3648.0 (http://www.jeasyui.com/forum/index.php?topic=3648.0)" aligns all types of textboxes including comboboxes. I am looking a style option only for number boxes.

Please help.


Title: Re: text-alignment for number boxes
Post by: Opan Mustopah on January 14, 2015, 06:45:47 PM
maybe you  can try adding a custom class to override .textbox-align with other class.
so it won't change all textbox alignment.



Title: Re: text-alignment for number boxes
Post by: gordis gmbh on January 15, 2015, 08:35:04 AM
Hi, thanks for the suggestion but that doesn't work because of the way textboxes are built in easyui. They use span elements and new text elements on which the css style '.textbox-text' etc. are applied. Here, an example:

My code for creating a numberbox:
Code:
<td>
Total Server:<br><input id="spCMSoD_kpiTotalServer" name="kpiTotalServer" readonly="readonly" class="easyui-numberbox" type="text" size="15" value="2">
</td>

The generated html output:
Code:
<td>
Total Server:
<br>
<input id="spCMSoD_kpiTotalServer" class="easyui-numberbox numberbox-f textbox-f" type="text" size="15" readonly="readonly" style="display: none;" textboxname="kpiTotalServer" numberboxname="kpiTotalServer">
<span class="textbox textbox-readonly numberbox" style="width: 108px; height: 20px;">
<input class="textbox-text textbox-text-readonly validatebox-text" type="text" autocomplete="off" readonly="readonly" placeholder="" style="margin-left: 0px; margin-right: 0px; padding-top: 2px; padding-bottom: 2px; width: 100px; ime-mode: disabled;">
<input class="textbox-value" type="hidden" name="kpiTotalServer" value="2">
</span>
</td>

The input element that I declare (id="spCMSoD_kpiTotalServer") is hidden using display:none. And a new input element with class="textbox-text textbox-text-readonly validatebox-text" is added. So the styling you apply has no effect. I think we need here a style option for textboxes