BUG 9106 "Enmascaramiento en grillas no permite decimales." SOLVED
- Percentage field defined with an mask does not allow decimal in grids - comma_separator attribute included in the code
This commit is contained in:
@@ -1365,7 +1365,7 @@ function G_Percentage( form, element, name )
|
|||||||
var me=this;
|
var me=this;
|
||||||
this.parent = G_Text;
|
this.parent = G_Text;
|
||||||
this.parent( form, element, name);
|
this.parent( form, element, name);
|
||||||
this.validate = 'Int';
|
//this.validate = 'Int'; //Commented for allow enter the character '.'
|
||||||
this.mType = 'percentage';
|
this.mType = 'percentage';
|
||||||
this.mask= '###.##';
|
this.mask= '###.##';
|
||||||
this.comma_separator = ".";
|
this.comma_separator = ".";
|
||||||
@@ -1377,7 +1377,7 @@ function G_Currency( form, element, name )
|
|||||||
var me=this;
|
var me=this;
|
||||||
this.parent = G_Text;
|
this.parent = G_Text;
|
||||||
this.parent( form, element, name);
|
this.parent( form, element, name);
|
||||||
//this.validate = 'Int'; //commented for allow enter the character '.'
|
//this.validate = 'Int'; //Commented for allow enter the character '.'
|
||||||
this.mType = 'currency';
|
this.mType = 'currency';
|
||||||
this.mask= '_###,###,###,###,###;###,###,###,###,###.00';
|
this.mask= '_###,###,###,###,###;###,###,###,###,###.00';
|
||||||
this.comma_separator = ".";
|
this.comma_separator = ".";
|
||||||
|
|||||||
@@ -60,26 +60,41 @@ var G_Grid = function(oForm, sGridName){
|
|||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'currency':
|
case 'currency':
|
||||||
while (oAux = document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']')) {
|
while (oAux = document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']')) {
|
||||||
this.aElements.push(new G_Currency(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j + ']['
|
this.aElements.push(new G_Currency(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j + ']['
|
||||||
+ this.aFields[i].sFieldName));
|
+ this.aFields[i].sFieldName));
|
||||||
if (aFields[i].oProperties) {
|
|
||||||
this.aElements[this.aElements.length - 1].mask = aFields[i].oProperties.mask;
|
if (this.aFields[i].oProperties) {
|
||||||
|
if (this.aFields[i].oProperties.comma_separator) {
|
||||||
|
this.aElements[this.aElements.length - 1].comma_separator = this.aFields[i].oProperties.comma_separator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.aElements[this.aElements.length - 1].mask = this.aFields[i].oProperties.mask;
|
||||||
|
}
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'percentage':
|
case 'percentage':
|
||||||
while (oAux = document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']')) {
|
while (oAux = document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']')) {
|
||||||
this.aElements.push(new G_Percentage(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j
|
this.aElements.push(new G_Percentage(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j
|
||||||
+ '][' + this.aFields[i].sFieldName));
|
+ '][' + this.aFields[i].sFieldName));
|
||||||
if (aFields[i].oProperties) {
|
|
||||||
this.aElements[this.aElements.length - 1].mask = aFields[i].oProperties.mask;
|
if (this.aFields[i].oProperties) {
|
||||||
|
if (this.aFields[i].oProperties.comma_separator) {
|
||||||
|
this.aElements[this.aElements.length - 1].comma_separator = this.aFields[i].oProperties.comma_separator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.aElements[this.aElements.length - 1].mask = this.aFields[i].oProperties.mask;
|
||||||
|
}
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'dropdown':
|
case 'dropdown':
|
||||||
while (oAux = document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']')) {
|
while (oAux = document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']')) {
|
||||||
this.aElements.push(new G_DropDown(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j + ']['
|
this.aElements.push(new G_DropDown(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j + ']['
|
||||||
@@ -90,6 +105,7 @@ var G_Grid = function(oForm, sGridName){
|
|||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
while (oAux = document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']')) {
|
while (oAux = document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']')) {
|
||||||
this.aElements.push(new G_Field(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j + ']['
|
this.aElements.push(new G_Field(oForm, document.getElementById('form[' + this.sGridName + '][' + j + '][' + this.aFields[i].sFieldName + ']'), this.sGridName + '][' + j + ']['
|
||||||
|
|||||||
Reference in New Issue
Block a user