sync
authorjohn <john@roojs.com>
Tue, 16 Oct 2018 04:45:43 +0000 (12:45 +0800)
committerjohn <john@roojs.com>
Tue, 16 Oct 2018 04:45:43 +0000 (12:45 +0800)
Roo/bootstrap/MoneyField.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 378a0a2..51c8800 100644 (file)
@@ -105,6 +105,13 @@ Roo.extend(Roo.bootstrap.MoneyField, Roo.bootstrap.ComboBox, {
             cls: 'hidden-number-input'
         };
         
+        if(
+            this.maxLength &&
+            Number.isInteger(this.maxLength * 1)
+        ) {
+            input.maxlength = this.maxLength; 
+        }
+        
         if (this.name) {
             hiddenInput.name = this.name;
         }
index dc0f919..0dc7ff6 100644 (file)
@@ -40513,6 +40513,13 @@ Roo.extend(Roo.bootstrap.MoneyField, Roo.bootstrap.ComboBox, {
             cls: 'hidden-number-input'
         };
         
+        if(
+            this.maxLength &&
+            Number.isInteger(this.maxLength * 1)
+        ) {
+            input.maxlength = this.maxLength; 
+        }
+        
         if (this.name) {
             hiddenInput.name = this.name;
         }
index cc86413..9c9176a 100644 (file)
@@ -1662,8 +1662,8 @@ var B="";for(var i=1;i<v.length;i++){var c=v.charAt(i);if(!isNaN(c)){B+=c;if(thi
 }this.setValue(this.getValue());}});
 // Roo/bootstrap/MoneyField.js
 Roo.bootstrap.MoneyField=function(A){Roo.bootstrap.MoneyField.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.MoneyField,Roo.bootstrap.ComboBox,{allowDecimals:true,decimalSeparator:".",decimalPrecision:0,allowNegative:true,allowZero:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",castInt:true,defaultCurrency:false,thousandsDelimiter:false,inputlg:9,inputmd:9,inputsm:9,inputxs:6,store:false,getAutoCreate:function(){var A=this.labelAlign||this.parentLabelAlign();
-var id=Roo.id();var B={cls:'form-group',cn:[]};var C={tag:'input',id:id,cls:'form-control roo-money-amount-input',autocomplete:'new-password'};var D={tag:'input',type:'hidden',id:Roo.id(),cls:'hidden-number-input'};if(this.name){D.name=this.name;}if(this.disabled){C.disabled=true;
-}var E=12-this.inputlg;var F=12-this.inputmd;var G=12-this.inputsm;var H=12-this.inputxs;var I={tag:'div',cls:'row roo-money-field',cn:[{tag:'div',cls:'roo-money-currency column col-lg-'+E+' col-md-'+F+' col-sm-'+G+' col-xs-'+H,cn:[{tag:'div',cls:'roo-select2-container input-group',cn:[{tag:'input',cls:'form-control roo-money-currency-input',autocomplete:'new-password',readOnly:1,name:this.currencyName}
+var id=Roo.id();var B={cls:'form-group',cn:[]};var C={tag:'input',id:id,cls:'form-control roo-money-amount-input',autocomplete:'new-password'};var D={tag:'input',type:'hidden',id:Roo.id(),cls:'hidden-number-input'};if(this.maxLength&&Number.isInteger(this.maxLength*1)){C.maxlength=this.maxLength;
+}if(this.name){D.name=this.name;}if(this.disabled){C.disabled=true;}var E=12-this.inputlg;var F=12-this.inputmd;var G=12-this.inputsm;var H=12-this.inputxs;var I={tag:'div',cls:'row roo-money-field',cn:[{tag:'div',cls:'roo-money-currency column col-lg-'+E+' col-md-'+F+' col-sm-'+G+' col-xs-'+H,cn:[{tag:'div',cls:'roo-select2-container input-group',cn:[{tag:'input',cls:'form-control roo-money-currency-input',autocomplete:'new-password',readOnly:1,name:this.currencyName}
 ,{tag:'span',cls:'input-group-addon',cn:[{tag:'span',cls:'caret'}]}]}]},{tag:'div',cls:'roo-money-amount column col-lg-'+this.inputlg+' col-md-'+this.inputmd+' col-sm-'+this.inputsm+' col-xs-'+this.inputxs,cn:[{tag:'div',cls:this.hasFeedback?'has-feedback':'',cn:[C]}
 ]}]};if(this.fieldLabel.length){var J={tag:'i',tooltip:'This field is required'};var K={tag:'label','for':id,cls:'control-label',cn:[]};var L={tag:'span',html:this.fieldLabel};J.cls='roo-required-indicator text-danger fa fa-lg fa-star left-indicator';K.cn=[J,L];
 if(this.indicatorpos=='right'){J.cls='roo-required-indicator text-danger fa fa-lg fa-star right-indicator';K.cn=[L,J];}if(A=='left'){I={tag:'div',cn:[I]};if(this.labelWidth>12){K.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;