BUG 6909 SOLVED. Field to insert PM variables fixed in grids.
This commit is contained in:
@@ -174,7 +174,6 @@ var G_Grid = function(oForm, sGridName){
|
|||||||
if ((aux4.indexOf ('display:none') > 0) || (aux4.indexOf('display: none')>0)){
|
if ((aux4.indexOf ('display:none') > 0) || (aux4.indexOf('display: none')>0)){
|
||||||
sw_display = true;
|
sw_display = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
pTxt = txt.split('="');
|
pTxt = txt.split('="');
|
||||||
for (v=1; v < pTxt.length; v++){
|
for (v=1; v < pTxt.length; v++){
|
||||||
aux = pTxt[v];
|
aux = pTxt[v];
|
||||||
@@ -235,11 +234,11 @@ var G_Grid = function(oForm, sGridName){
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
eNodeName = aCells[i].innerHTML.substring(aCells[i].innerHTML.indexOf('<')+1, aCells[i].innerHTML.indexOf(' '));
|
eNodeName = aCells[i].innerHTML.substring(aCells[i].innerHTML.indexOf('<')+1, aCells[i].innerHTML.indexOf(' '));
|
||||||
eNodeName = eNodeName.toLowerCase();
|
eNodeName = eNodeName.toLowerCase();
|
||||||
switch(eNodeName){
|
switch(eNodeName){
|
||||||
case 'input':
|
case 'input':
|
||||||
aObjects = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('input');
|
aObjects = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('input');
|
||||||
if (aObjects){
|
if (aObjects){
|
||||||
newID = aObjects[0].id.replace(/\[1\]/g, '\[' + currentRow + '\]');
|
newID = aObjects[0].id.replace(/\[1\]/g, '\[' + currentRow + '\]');
|
||||||
aObjects[0].id = newID;
|
aObjects[0].id = newID;
|
||||||
aObjects[0].name = newID;
|
aObjects[0].name = newID;
|
||||||
@@ -249,53 +248,61 @@ var G_Grid = function(oForm, sGridName){
|
|||||||
}else{
|
}else{
|
||||||
defaultValue = '';
|
defaultValue = '';
|
||||||
}
|
}
|
||||||
switch(aObjects[0].type){
|
for(n=0; n < aObjects.length; n++){
|
||||||
case 'text': //TEXTBOX, CURRENCY, PERCENTAGE, DATEPICKER
|
switch(aObjects[n].type){
|
||||||
tags = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('a');
|
case 'text': //TEXTBOX, CURRENCY, PERCENTAGE, DATEPICKER
|
||||||
if (tags.length == 2){ //DATEPICKER
|
tags = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('a');
|
||||||
//Copy Images
|
if (tags.length == 2){ //DATEPICKER
|
||||||
img1 = tags[0].innerHTML;
|
//Copy Images
|
||||||
img2 = tags[1].innerHTML;
|
img1 = tags[0].innerHTML;
|
||||||
//Create new trigger name
|
img2 = tags[1].innerHTML;
|
||||||
var datePickerTriggerId = tags[1].id.replace(/\[1\]/g, '\[' + currentRow + '\]');
|
//Create new trigger name
|
||||||
//Remove 'a' tag for date picker trigger
|
var datePickerTriggerId = tags[1].id.replace(/\[1\]/g, '\[' + currentRow + '\]');
|
||||||
oNewRow.getElementsByTagName('td')[i].removeChild(tags[1]);
|
//Remove 'a' tag for date picker trigger
|
||||||
//Capture Script and remove
|
oNewRow.getElementsByTagName('td')[i].removeChild(tags[1]);
|
||||||
scriptTags = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('script');
|
//Capture Script and remove
|
||||||
oNewRow.getElementsByTagName('td')[i].removeChild(scriptTags[0]);
|
scriptTags = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('script');
|
||||||
//Create 'a' to remove Date
|
oNewRow.getElementsByTagName('td')[i].removeChild(scriptTags[0]);
|
||||||
if (tags[0].onclick){
|
//Create 'a' to remove Date
|
||||||
var onclickevn = new String(tags[0].onclick);
|
if (tags[0].onclick){
|
||||||
eval('tags[0].onclick = ' + onclickevn.replace(/\[1\]/g, '\[' + currentRow + '\]') + ';');
|
var onclickevn = new String(tags[0].onclick);
|
||||||
}
|
eval('tags[0].onclick = ' + onclickevn.replace(/\[1\]/g, '\[' + currentRow + '\]') + ';');
|
||||||
//Create new 'a' to trigger DatePicker
|
}
|
||||||
var a2 = document.createElement('a');
|
//Create new 'a' to trigger DatePicker
|
||||||
a2.id = datePickerTriggerId;
|
var a2 = document.createElement('a');
|
||||||
a2.innerHTML = img2;
|
a2.id = datePickerTriggerId;
|
||||||
oNewRow.getElementsByTagName('td')[i].appendChild(a2);
|
a2.innerHTML = img2;
|
||||||
//Load DatePicker Trigger
|
oNewRow.getElementsByTagName('td')[i].appendChild(a2);
|
||||||
datePicker4("", newID, attributes.mask, attributes.start, attributes.end, attributes.time);
|
//Load DatePicker Trigger
|
||||||
aObjects[0].value = defaultValue;
|
datePicker4("", newID, attributes.mask, attributes.start, attributes.end, attributes.time);
|
||||||
}else{
|
aObjects[n].value = defaultValue;
|
||||||
if (_BROWSER.name == 'msie'){ //Clone new input element if browser is IE
|
|
||||||
oNewOBJ = this.cloneInput(aObjects[0]);
|
|
||||||
oNewOBJ.value = defaultValue;
|
|
||||||
parentGG = aObjects[0].parentNode;
|
|
||||||
parentGG.removeChild(aObjects[0]);
|
|
||||||
parentGG.appendChild(oNewOBJ);
|
|
||||||
}else{
|
}else{
|
||||||
aObjects[0].value = defaultValue;
|
if (_BROWSER.name == 'msie' && aObjects.length==1){ //Clone new input element if browser is IE
|
||||||
|
oNewOBJ = this.cloneInput(aObjects[n]);
|
||||||
|
oNewOBJ.value = defaultValue;
|
||||||
|
parentGG = aObjects[n].parentNode;
|
||||||
|
parentGG.removeChild(aObjects[n]);
|
||||||
|
parentGG.appendChild(oNewOBJ);
|
||||||
|
}else{
|
||||||
|
aObjects[n].value = defaultValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
break;
|
case 'checkbox': //CHECKBOX
|
||||||
case 'checkbox': //CHECKBOX
|
aObjects[n].checked = false;
|
||||||
aObjects[0].checked = false;
|
aObjects[n].value = defaultValue;
|
||||||
aObjects[0].value = defaultValue;
|
break;
|
||||||
break;
|
case 'hidden': //HIDDEN
|
||||||
case 'hidden': //HIDDEN
|
if ((attributes.gridtype != 'yesno' && attributes.gridtype != 'dropdown') || typeof attributes.gridtype == 'undefined')
|
||||||
if ((attributes.gridtype != 'yesno' && attributes.gridtype != 'dropdown') || typeof attributes.gridtype == 'undefined')
|
aObjects[n].value = defaultValue;
|
||||||
aObjects[0].value = defaultValue;
|
break;
|
||||||
break;
|
case 'button':
|
||||||
|
if (aObjects[n].onclick){
|
||||||
|
var onclickevn = new String(aObjects[n].onclick);
|
||||||
|
eval('aObjects[n].onclick = ' + onclickevn.replace(/\[1\]/g, '\[' + currentRow + '\]') + ';');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aObjects = null;
|
aObjects = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user