//Copyright (c) 2001-2016 Aspose Pty Ltd. All Rights Reserved. /***************************************************** * Aspose.Cells.GridWeb Component Script File * Copyright 2003-2011, All Rights Reserverd. * V2.4.0 *****************************************************/ function onselectchange(o) { o.parentNode.firstChild.value=o.options[o.selectedIndex].value; } function oncheckboxclick(o) { o.parentNode.firstChild.value = o.checked? "TRUE":"FALSE"; } function savePos(gform) { var pos = document.getElementById(gform.id + "_POS"); pos.value = document.body.scrollLeft + "|" + document.body.scrollTop; } function initPos(gform) { if (getattr(gform, "bodyleft") != null) document.body.scrollLeft = getattr(gform, "bodyleft"); if (getattr(gform, "bodytop") != null) document.body.scrollTop = getattr(gform, "bodytop"); } function formValidateAll(gform) { var vresult = true; var ftab = document.getElementById(gform.id + "_ETAB"); var decimalpoint = getattr(gform, "decimalpoint"); for (var r=0; r0 ? m[2] : "0") + "." + m[4]; num = parseFloat(cleanInput); return (isNaN(num) ? null : num); } else if (dataType == "Date") { var yearFirstExp = /^(\d{4})-(\d{2})-(\d{2})$/; m = op.match(yearFirstExp); var day, month, year; if (m != null) { year = m[1]; month = m[2]; day = m[3]; } else { return null; } month-=1; var date = new Date(year, month, day); return (typeof(date) == "object" && year == date.getFullYear() && month == date.getMonth() && day == date.getDate()) ? date.valueOf() : null; } else if (dataType == "DateTime") { var yearFirstExp = /^(\d{4})-(\d{2})-(\d{2}) (\d+)\:(\d+)\:(\d+)$/; m = op.match(yearFirstExp); var day, month, year, hour, minu, sec; if (m != null) { year = m[1]; month = m[2]; day = m[3]; hour = m[4]; minu = m[5]; sec = m[6]; } else { return null; } month-=1; var date = new Date(year, month, day, hour, minu, sec); return (typeof(date) == "object" && year == date.getFullYear() && month == date.getMonth() && day == date.getDate() && hour == date.getHours() && minu == date.getMinutes() && sec == date.getSeconds()) ? date.valueOf() : null; } else { return op.toString(); } } function setValid(o) { o.style.border = ""; } function setInvalid(o) { o.style.border = "1px dotted red"; } function dateBtnClick(gform, o) { var Calendar = o.calendar; if (Calendar != null) { o.calendar = null; Calendar.removeNode(true); } else { Calendar = document.createElement("SPAN"); document.body.appendChild(Calendar); Calendar.dateBtn = o; Calendar.style.position = "absolute"; Calendar.style.display = "block"; Calendar.style.width = 280; Calendar.style.height = 150; Calendar.style.zIndex = 99999999; o.calendar = Calendar; Calendar.style.posLeft = document.body.scrollLeft + event.clientX; Calendar.style.posTop = document.body.scrollTop + event.clientY; var left = Calendar.offsetLeft - event.offsetX - 1; if (left < 0) left = 0; var top = Calendar.offsetTop + o.offsetHeight - event.offsetY - 1; if (top < 0) top = 0; Calendar.style.posLeft = left; Calendar.style.posTop = top; Calendar.addBehavior(gform.acw_client_path+"calendar.htc"); if (Calendar.readyState == "complete") Calendar.attachEvent("onpropertychange", onCalendarChange); else Calendar.onreadystatechange = onCalendarReady; } } function onCalendarReady() { var Calendar = event.srcElement; if (Calendar.readyState == "complete") Calendar.attachEvent("onpropertychange", onCalendarChange); } function onCalendarChange() { var Calendar = event.srcElement; var ActiveCell = Calendar.dateBtn.parentElement.firstChild; if (event.propertyName == "day") { var day = Calendar.day.toString(); if (day.length == 1) day = '0' + day; var month = Calendar.month.toString(); if (month.length == 1) month = '0' + month; var datestr = Calendar.year.toString() + '-' + month + '-' + day; ActiveCell.value = datestr; Calendar.dateBtn.calendar = null; Calendar.removeNode(true); } } function enableAll(gform) { var eles = gform.getElementsByTagName("INPUT"); for (var i=0; i