BUG-15572: En IE 8, 9,10 al tener un campo tipo date en una grilla SOLVED
- When you add a field loses focus. - A validation was add when the browser is IE, in file grid.js and function addGridRow.
This commit is contained in:
@@ -421,41 +421,61 @@ var G_Grid = function(oForm, sGridName){
|
||||
|
||||
tags = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('a');
|
||||
if (tags.length == 2){ //DATEPICKER
|
||||
//Copy Images
|
||||
//img1 = tags[0].innerHTML;
|
||||
img2 = tags[1].innerHTML;
|
||||
//Create new trigger name
|
||||
var datePickerTriggerId = tags[1].id.replace(/\[1\]/g, '\[' + currentRow + '\]');
|
||||
//Remove 'a' tag for date picker trigger
|
||||
oNewRow.getElementsByTagName('td')[i].removeChild(tags[1]);
|
||||
//Capture Script and remove
|
||||
var scriptTags = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('script');
|
||||
oNewRow.getElementsByTagName('td')[i].removeChild(scriptTags[0]);
|
||||
//Create 'a' to remove Date
|
||||
if (tags[0].onclick){
|
||||
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');
|
||||
|
||||
if (_BROWSER.name == 'msie' && aObjects.length==1) {
|
||||
//Clone new input element if browser is IE
|
||||
var oNewOBJ = this.cloneElement(aObjects[n]);
|
||||
oNewOBJ.value = defaultValue;
|
||||
var parentGG = aObjects[n].parentNode;
|
||||
parentGG.removeChild(aObjects[n]);
|
||||
parentGG.appendChild(oNewOBJ);
|
||||
}
|
||||
//Copy Images
|
||||
img1 = tags[0].innerHTML;
|
||||
img2 = tags[1].innerHTML;
|
||||
//Create new trigger name
|
||||
var datePickerTriggerId = tags[1].id.replace(/\[1\]/g, '\[' + currentRow + '\]');
|
||||
//Remove 'a' tag for date picker trigger
|
||||
oNewRow.getElementsByTagName('td')[i].removeChild(tags[1]);
|
||||
//Capture Script and remove
|
||||
var scriptTags = oNewRow.getElementsByTagName('td')[i].getElementsByTagName('script');
|
||||
oNewRow.getElementsByTagName('td')[i].removeChild(scriptTags[0]);
|
||||
//Create 'a' to remove Date
|
||||
var a1 = tags[0];
|
||||
if (tags[0].onclick){
|
||||
if (_BROWSER.name == 'msie' && aObjects.length==1) {
|
||||
//style 'a' to remove Date
|
||||
var styleText = "left: -28px; top: 2px; position: relative;";
|
||||
a1.style.setAttribute("cssText", styleText );
|
||||
}
|
||||
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');
|
||||
if( a2.style.setAttribute ) {
|
||||
var styleText = "position: relative; top: 2px; left: -13px;";
|
||||
a2.style.setAttribute("cssText", styleText );
|
||||
var styleText = "position: relative; top: 2px; left: -13px;";
|
||||
if (_BROWSER.name == 'msie' && aObjects.length==1) {
|
||||
var styleText = "position: relative; top: 2px; left: -4px;";
|
||||
}
|
||||
a2.style.setAttribute("cssText", styleText );
|
||||
}
|
||||
else {
|
||||
var styleText = "position: relative; top: 2px; left: -16px;";
|
||||
a2.setAttribute("style", styleText );
|
||||
}
|
||||
|
||||
a2.id = datePickerTriggerId;
|
||||
a2.innerHTML = img2;
|
||||
oNewRow.getElementsByTagName('td')[i].appendChild(a2);
|
||||
a2.id = datePickerTriggerId;
|
||||
a2.innerHTML = img2;
|
||||
oNewRow.getElementsByTagName('td')[i].appendChild(a2);
|
||||
|
||||
//Load DatePicker Trigger
|
||||
datePicker4("", newID, attributes.mask, attributes.start, attributes.end, attributes.time);
|
||||
if (_BROWSER.name == 'msie' && aObjects.length==1) {
|
||||
a1.innerHTML = img1;
|
||||
oNewRow.getElementsByTagName('td')[i].appendChild(a1);
|
||||
}
|
||||
//Load DatePicker Trigger
|
||||
datePicker4("", newID, attributes.mask, attributes.start, attributes.end, attributes.time);
|
||||
|
||||
aObjects[n].value = defaultValue;
|
||||
aObjects[n].value = defaultValue;
|
||||
}else{
|
||||
if (_BROWSER.name == 'msie' && aObjects.length==1){ //Clone new input element if browser is IE
|
||||
var oNewOBJ = this.cloneElement(aObjects[n]);
|
||||
|
||||
Reference in New Issue
Block a user