EasyUI Forum
August 08, 2022, 11:41:03 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Width attribute of textbox doesn't work  (Read 41 times)
galcott
Newbie
*
Posts: 21


View Profile
« on: August 04, 2022, 11:48:34 AM »

It seems that setting the width attribute of a textbox doesn't work and it has to be done in a style tag.

This doesn't work - the width is ignored:
Code:
<INPUT class='easyui-textbox' ID='txtPatient' label='Patient' labelWidth=70 width=350>

This does work:
Code:
<INPUT class='easyui-textbox' ID='txtPatient' label='Patient' labelWidth=70 style='width: 350px'>

Am I missing something here or is this a bug?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2105


View Profile Email
« Reply #1 on: August 05, 2022, 12:06:39 AM »

Please use the 'data-options' instead to define all the properties.
Code:
<INPUT class='easyui-textbox' ID='txtPatient' data-options="label:'Patient',labelWidth:70,width:350">

Or override the $.fn.textbox.parseOptions to parse the 'width' and 'height' properties.
Code:
<script>
(function($){
var parser = $.fn.textbox.parseOptions;
$.fn.textbox.parseOptions = function(target){
var extOpts = $.parser.parseOptions(target, ['width','height']);
return $.extend({}, extOpts, parser(target));
}
})(jQuery);
</script>
Logged
galcott
Newbie
*
Posts: 21


View Profile
« Reply #2 on: August 05, 2022, 06:41:44 AM »

I don't want to use data-options since I already have a page with over 100 textboxes defined as in the code I posted. Why do the other properties work and width doesn't? They should all behave consistently. This is a bug!
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!