Merge pull request #323 from victorsl/BUG-8489

BUG 8489 "Los aplicados a los elementos de las grillas no..." SOLVED
This commit is contained in:
julceslauhub
2012-07-18 14:34:23 -07:00
2 changed files with 197 additions and 167 deletions

View File

@@ -3437,37 +3437,37 @@ function hideRowsById(aFields){
function dateSetMask(mask) { function dateSetMask(mask) {
if (mask != '') { if (mask != '') {
mask = stringReplace("%y", "yy", mask); mask = strReplace("%y", "yy", mask);
mask = stringReplace("%Y", "yyyy", mask); mask = strReplace("%Y", "yyyy", mask);
mask = stringReplace("%m", "mm", mask); mask = strReplace("%m", "mm", mask);
mask = stringReplace("%o", "mm", mask); mask = strReplace("%o", "mm", mask);
mask = stringReplace("%d", "dd", mask); mask = strReplace("%d", "dd", mask);
mask = stringReplace("%e", "dd", mask); mask = strReplace("%e", "dd", mask);
//In the function getCleanMask valid characters for an mask that does not //In the function getCleanMask valid characters for an mask that does not
//is currency/percentage are: '0 ',' # ',' d ',' m ',' y ',' Y '. //is currency/percentage are: '0 ',' # ',' d ',' m ',' y ',' Y '.
//For hours, minutes and seconds replace this mask with '#' //For hours, minutes and seconds replace this mask with '#'
mask = stringReplace("%H", "##", mask); mask = strReplace("%H", "##", mask);
mask = stringReplace("%I", "##", mask); mask = strReplace("%I", "##", mask);
mask = stringReplace("%k", "##", mask); mask = strReplace("%k", "##", mask);
mask = stringReplace("%l", "##", mask); mask = strReplace("%l", "##", mask);
mask = stringReplace("%M", "##", mask); mask = strReplace("%M", "##", mask);
mask = stringReplace("%S", "##", mask); mask = strReplace("%S", "##", mask);
mask = stringReplace("%j", "###", mask); mask = strReplace("%j", "###", mask);
} }
return mask; return mask;
} }
function stringReplace(strSearch, strReplace, str) { function strReplace(strs, strr, str)
var expression = eval("/" + strSearch + "/g"); {
var expresion = eval("/" + strs + "/g");
return str.replace(expression, strReplace); return str.replace(expresion, strr);
} }
/* end file */ /* end file */

View File

@@ -204,7 +204,6 @@ var G_Grid = function(oForm, sGridName){
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
this.cloneInput = function(oNewObject){ this.cloneInput = function(oNewObject){
var newField;
var txt = oNewObject.parentNode.innerHTML; var txt = oNewObject.parentNode.innerHTML;
var xClass = 'module_app_input___gray'; var xClass = 'module_app_input___gray';
@@ -214,42 +213,74 @@ var G_Grid = function(oForm, sGridName){
txt = txt.replace('/>', ''); txt = txt.replace('/>', '');
txt = txt.replace('>', ''); txt = txt.replace('>', '');
aux4 = txt.toLowerCase(); var strAux = strReplace(' ', '', txt);
aux4 = aux4.replace(' ',''); strAux = strAux.toLowerCase();
sw_display = false;
if ((aux4.indexOf ('display:none') > 0) || (aux4.indexOf('display: none')>0)){ var sw_display = (strAux.indexOf('display:none') > 0)? true : false;
sw_display = true;
} var arrayElemTxt = txt.split('="');
pTxt = txt.split('="'); var pos = 0;
for (v=1; v < pTxt.length; v++){ var strAux2 = '';
aux = pTxt[v]; var strAux3 = '';
if (pos = aux.indexOf('"')){
aux2 = aux.substr(0,pos); for (var i = 0; i <= arrayElemTxt.length - 1; i++) {
aux3 = aux2.replace(' ','[%space$]'); strAux = arrayElemTxt[i];
pTxt[v] = aux.replace(aux2, aux3); pos = strAux.indexOf('"');
if (pos > 0) {
strAux2 = strAux.substr(0, pos);
strAux3 = strReplace(' ', '__%SPACE__', strAux2)
arrayElemTxt[i] = strAux.replace(strAux2, strAux3);
} }
} }
txt = pTxt.join('="');
aTxt = txt.split(' '); txt = arrayElemTxt.join('="');
var strStyle = (sw_display)? " style=\"display: none;\"" : ""; arrayElemTxt = txt.split(' ');
var strDisabled = (oNewObject.disabled)? " disabled=\"disabled\"" : "";
var strReadOnly = (oNewObject.readOnly)? " readonly=\"readonly\"" : "";
var xElement = "<input id=\"" + oNewObject.id + "\" name=\"" + oNewObject.id + "\" class=\"" + xClass + "\"" + strStyle + strDisabled + strReadOnly + " />"; var arrayAttribute = [];
var arrayAttributeValue = [];
var strStyle = '';
newField = document.createElement(xElement); for (var i = 0; i <= arrayElemTxt.length - 1; i++) {
if (arrayElemTxt[i].indexOf('=') > 0) {
aVals = arrayElemTxt[i].split('=');
aVals[0] = aVals[0].toLowerCase();
aVals[1] = strReplace('"', '', aVals[1])
aVals[1] = strReplace('__%SPACE__', ' ', aVals[1])
for (var a=0; a < aTxt.length; a++){ if (aVals[0] != 'id' && aVals[0] != 'name' && aVals[0] != 'class' && aVals[0] != 'style') {
if (aTxt[a].indexOf('=')>0){ arrayAttribute.push(aVals[0]);
aVals = aTxt[a].split('='); arrayAttributeValue.push(aVals[1]);
} else {
if (aVals[0] != 'id' && aVals[0] != 'name' && aVals[0] != 'class' && aVals[0] != 'style'){ if (aVals[0] == 'style') {
newField.setAttribute(aVals[0], aVals[1].replace('"','').replace('"','').replace('[%space$]',' ')); strStyle = aVals[1];
} }
} }
} }
}
strStyle = ((sw_display)? "display: none;" : "") + strStyle;
var newField = document.createElement("input");
newField.setAttribute("id", oNewObject.id);
newField.setAttribute("name", oNewObject.id);
newField.className = xClass;
newField.style.cssText = strStyle;
if (oNewObject.disabled) {
newField.disabled = true;
}
if (oNewObject.readOnly) {
newField.readOnly = true;
}
for (var i = 0; i <= arrayAttribute.length - 1; i++) {
newField.setAttribute(arrayAttribute[i], arrayAttributeValue[i]);
}
return newField; return newField;
}; };
@@ -1216,7 +1247,6 @@ var G_Grid = function(oForm, sGridName){
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@mail.com> * @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@mail.com>
*/ */
function deleteRowOnDynaform(grid, sRow) { function deleteRowOnDynaform(grid, sRow) {
var oRPC = new leimnud.module.rpc.xmlhttp( { var oRPC = new leimnud.module.rpc.xmlhttp( {
url : '../gulliver/genericAjax', url : '../gulliver/genericAjax',