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:
@@ -3437,37 +3437,37 @@ function hideRowsById(aFields){
|
||||
|
||||
function dateSetMask(mask) {
|
||||
if (mask != '') {
|
||||
mask = stringReplace("%y", "yy", mask);
|
||||
mask = stringReplace("%Y", "yyyy", mask);
|
||||
mask = strReplace("%y", "yy", mask);
|
||||
mask = strReplace("%Y", "yyyy", mask);
|
||||
|
||||
mask = stringReplace("%m", "mm", mask);
|
||||
mask = stringReplace("%o", "mm", mask);
|
||||
mask = strReplace("%m", "mm", mask);
|
||||
mask = strReplace("%o", "mm", mask);
|
||||
|
||||
mask = stringReplace("%d", "dd", mask);
|
||||
mask = stringReplace("%e", "dd", mask);
|
||||
mask = strReplace("%d", "dd", mask);
|
||||
mask = strReplace("%e", "dd", mask);
|
||||
|
||||
//In the function getCleanMask valid characters for an mask that does not
|
||||
//is currency/percentage are: '0 ',' # ',' d ',' m ',' y ',' Y '.
|
||||
//For hours, minutes and seconds replace this mask with '#'
|
||||
mask = stringReplace("%H", "##", mask);
|
||||
mask = stringReplace("%I", "##", mask);
|
||||
mask = stringReplace("%k", "##", mask);
|
||||
mask = stringReplace("%l", "##", mask);
|
||||
mask = strReplace("%H", "##", mask);
|
||||
mask = strReplace("%I", "##", mask);
|
||||
mask = strReplace("%k", "##", mask);
|
||||
mask = strReplace("%l", "##", mask);
|
||||
|
||||
mask = stringReplace("%M", "##", mask);
|
||||
mask = stringReplace("%S", "##", mask);
|
||||
mask = strReplace("%M", "##", mask);
|
||||
mask = strReplace("%S", "##", mask);
|
||||
|
||||
mask = stringReplace("%j", "###", mask);
|
||||
mask = strReplace("%j", "###", mask);
|
||||
}
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
||||
function stringReplace(strSearch, strReplace, str) {
|
||||
var expression = eval("/" + strSearch + "/g");
|
||||
function strReplace(strs, strr, str)
|
||||
{
|
||||
var expresion = eval("/" + strs + "/g");
|
||||
|
||||
return str.replace(expression, strReplace);
|
||||
return str.replace(expresion, strr);
|
||||
}
|
||||
|
||||
/* end file */
|
||||
|
||||
|
||||
@@ -204,7 +204,6 @@ var G_Grid = function(oForm, sGridName){
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
this.cloneInput = function(oNewObject){
|
||||
var newField;
|
||||
var txt = oNewObject.parentNode.innerHTML;
|
||||
var xClass = 'module_app_input___gray';
|
||||
|
||||
@@ -214,42 +213,74 @@ var G_Grid = function(oForm, sGridName){
|
||||
txt = txt.replace('/>', '');
|
||||
txt = txt.replace('>', '');
|
||||
|
||||
aux4 = txt.toLowerCase();
|
||||
aux4 = aux4.replace(' ','');
|
||||
sw_display = false;
|
||||
if ((aux4.indexOf ('display:none') > 0) || (aux4.indexOf('display: none')>0)){
|
||||
sw_display = true;
|
||||
}
|
||||
pTxt = txt.split('="');
|
||||
for (v=1; v < pTxt.length; v++){
|
||||
aux = pTxt[v];
|
||||
if (pos = aux.indexOf('"')){
|
||||
aux2 = aux.substr(0,pos);
|
||||
aux3 = aux2.replace(' ','[%space$]');
|
||||
pTxt[v] = aux.replace(aux2, aux3);
|
||||
var strAux = strReplace(' ', '', txt);
|
||||
strAux = strAux.toLowerCase();
|
||||
|
||||
var sw_display = (strAux.indexOf('display:none') > 0)? true : false;
|
||||
|
||||
var arrayElemTxt = txt.split('="');
|
||||
var pos = 0;
|
||||
var strAux2 = '';
|
||||
var strAux3 = '';
|
||||
|
||||
for (var i = 0; i <= arrayElemTxt.length - 1; i++) {
|
||||
strAux = arrayElemTxt[i];
|
||||
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;\"" : "";
|
||||
var strDisabled = (oNewObject.disabled)? " disabled=\"disabled\"" : "";
|
||||
var strReadOnly = (oNewObject.readOnly)? " readonly=\"readonly\"" : "";
|
||||
arrayElemTxt = txt.split(' ');
|
||||
|
||||
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 a=0; a < aTxt.length; a++){
|
||||
if (aTxt[a].indexOf('=')>0){
|
||||
aVals = aTxt[a].split('=');
|
||||
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])
|
||||
|
||||
if (aVals[0] != 'id' && aVals[0] != 'name' && aVals[0] != 'class' && aVals[0] != 'style') {
|
||||
newField.setAttribute(aVals[0], aVals[1].replace('"','').replace('"','').replace('[%space$]',' '));
|
||||
arrayAttribute.push(aVals[0]);
|
||||
arrayAttributeValue.push(aVals[1]);
|
||||
} else {
|
||||
if (aVals[0] == 'style') {
|
||||
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;
|
||||
};
|
||||
@@ -1216,7 +1247,6 @@ var G_Grid = function(oForm, sGridName){
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@mail.com>
|
||||
*/
|
||||
|
||||
|
||||
function deleteRowOnDynaform(grid, sRow) {
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp( {
|
||||
url : '../gulliver/genericAjax',
|
||||
|
||||
Reference in New Issue
Block a user