EasyUI Forum
May 10, 2024, 09:47:11 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: text-alignment for number boxes  (Read 9643 times)
gordis gmbh
Full Member
***
Posts: 103


View Profile Email
« 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" aligns all types of textboxes including comboboxes. I am looking a style option only for number boxes.

Please help.
Logged
Opan Mustopah
Full Member
***
Posts: 164


Indonesia


View Profile Email
« Reply #1 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.

Logged

-- Bajak Otak --
*** Sorry for my bad english :3 ***
--JeasyUI version 1.4--
gordis gmbh
Full Member
***
Posts: 103


View Profile Email
« Reply #2 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
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!