⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 igf_input.js

📁 一个JSF的商业组件的DEMO,infragistics-netadvantage.lic:NetAdvantage for JSF Vol1 2008,m21A99D6A11FF-9B33DC4B8
💻 JS
📖 第 1 页 / 共 2 页
字号:
else{if(this.isSelected()){css=this.getSelectedClass();}
if(this.isHovered()){if(!ig.isNull(css)){css=css+" "+this.getHoverClass();}
else{css=this.getHoverClass();}
this.setAttribute("ocbh",this.elm.className);}
if(!css){css=this.getDefaultClass();}}
if(!css){css="";}}
return css;};IgCalendarDay.prototype.getNextSibling=function(oe){var tmp=this.callSuper("IgUIElement","getNextSibling",oe);if(ig.isNull(tmp)){var cellIndex=this.elm.cellIndex;var tr=this.elm.parentNode;var rowIndex=tr.sectionRowIndex;if(rowIndex<5){var nextTr=tr.nextSibling;if(!ig.isNull(nextTr)){var firstTd=nextTr.firstChild;tmp=ig.getUIElementById(firstTd);}}}
return tmp;};IgCalendarDay.prototype.getPreviousSibling=function(oe){var tmp=this.callSuper("IgUIElement","getPreviousSibling",oe);if(ig.isNull(tmp)){var cellIndex=this.elm.cellIndex;var tr=this.elm.parentNode;var rowIndex=tr.sectionRowIndex;if(rowIndex>0){var prevTr=tr.previousSibling;var lastTd=prevTr.lastChild;tmp=new IgCalendarDay(lastTd);}}
return tmp;};IgCalendarDay.prototype.getUpSibling=function(oe){var cellIndex=this.elm.cellIndex;var tr=this.elm.parentNode;var rowIndex=tr.sectionRowIndex;if(rowIndex>0){var prevTr=tr.previousSibling;var Td=prevTr.childNodes[cellIndex];return new IgCalendarDay(Td);}else{}};IgCalendarDay.prototype.getDownSibling=function(oe){var result=null;var cellIndex=this.elm.cellIndex;var tr=this.elm.parentNode;var rowIndex=tr.sectionRowIndex;if(rowIndex<5){var nextTr=tr.nextSibling;if(!ig.isNull(nextTr)){var td=nextTr.childNodes[cellIndex];result=ig.getUIElementById(td);}}
return result;};IgCalendarDay.prototype.onKeyDown=function(evt){switch(evt.keyCode){case evt.KEY_LEFT:var ps=this.getPreviousSibling();if(!ig.isNull(ps)&&ps.focus){ps.focus();}
break;case evt.KEY_RIGHT:var ns=this.getNextSibling();if(!ig.isNull(ns)&&ns.focus){ns.focus();}
evt.preventDefault();break;case evt.KEY_UP:var us=this.getUpSibling();if(!ig.isNull(us)&&us.focus){us.focus();}
evt.preventDefault();break;case evt.KEY_DOWN:var ds=this.getDownSibling();if(!ig.isNull(ds)&&ds.focus){ds.focus();}
evt.preventDefault();break;case evt.KEY_ESCAPE:var cal=this.getParentComponent();if(!ig.isNull(cal)){cal.hide(true);}
break;case evt.KEY_RETURN:this.onDoubleClick();break;}};IgCalendarDay.prototype.onClick=function(){this.select();var cal=this.getParentComponent();if(!ig.isNull(cal)){cal.setSelectedDate(this.getDate());var oInput=cal.getDateChooser();oInput=ig.getUIElementById(oInput);oInput.setDate(cal.getSelectedDate());if(cal.isVisible()){cal.hide(true);}}};IgCalendarDay.prototype.onDoubleClick=function(){};IgCalendarDay.prototype.getDate=function(){var tmp=this.getAttribute("oDate");if(ig.NaES(tmp)){return new Date(parseInt(tmp));}
return null;};ig.augment(IgCalendarDay,IgUIElement);function IgCalendarPopup(e){this.IgCalendar(e);};IgCalendarPopup.prototype.getDateChooser=function(){return this.elm._dateChooser;};IgCalendarPopup.prototype.init=function(dateChooser){this.elm.setAttribute(ig.PROP_DEFAULT_CLASS,dateChooser.elm.getAttribute(ig.input.CSS_DEFAULT_CALENDAR)+"");this.elm.setAttribute(ig.input.CSS_DEFAULT_DATE,dateChooser.elm.getAttribute(ig.input.CSS_DEFAULT_DATE)+"");this.elm.setAttribute(ig.input.CSS_DISABLED_DATE,dateChooser.elm.getAttribute(ig.input.CSS_DISABLED_DATE)+"");this.elm.setAttribute(ig.input.CSS_HOVER_DATE,dateChooser.elm.getAttribute(ig.input.CSS_HOVER_DATE)+"");this.elm.setAttribute(ig.input.CSS_SELECTED_DATE,dateChooser.elm.getAttribute(ig.input.CSS_SELECTED_DATE)+"");this.elm.setAttribute(ig.input.CSS_HEADER,dateChooser.elm.getAttribute(ig.input.CSS_HEADER)+"");this.elm.setAttribute(ig.input.CSS_DAY_HEADER,dateChooser.elm.getAttribute(ig.input.CSS_DAY_HEADER)+"");this.elm.setAttribute(ig.input.CSS_CALENDAR_DAY_NOT_CURRENT_MONTH,dateChooser.elm.getAttribute(ig.input.CSS_CALENDAR_DAY_NOT_CURRENT_MONTH)+"");this.setMinDate(dateChooser.elm.getAttribute(ig.input.MIN_DATE));this.setMaxDate(dateChooser.elm.getAttribute(ig.input.MAX_DATE));this.setFirstDayOfWeek(dateChooser.elm.getAttribute(ig.input.FIRST_DAY_OF_WEEK));this.setDayList(dateChooser.elm.getAttribute(ig.input.DAY_LIST));this.setLongDayList(dateChooser.elm.getAttribute(ig.input.LONG_DAY_LIST));this.setMonthList(dateChooser.elm.getAttribute(ig.input.MONTH_LIST));this.setShortDayList(dateChooser.elm.getAttribute(ig.input.SHORT_DAY_LIST));this.setShortMonthList(dateChooser.elm.getAttribute(ig.input.SHORT_MONTH_LIST));this.setShowDayHeader(dateChooser.elm.getAttribute(ig.input.SHOW_DAY_HEADER));this.setShowHeader(dateChooser.elm.getAttribute(ig.input.SHOW_HEADER));this.populateMonthYear();this.setDisplayedDate(null);this.setSelectedDate(dateChooser.getDate());};IgCalendarPopup.prototype.repaint=function(){}
IgCalendarPopup.prototype.rebuild=function(){this.callSuper("IgCalendar","repaint");var curDate=this.getDisplayedDate();var year=curDate.getFullYear();var month=curDate.getMonth();var selectedDate=this.getSelectedDate();var firstDayInMonth=curDate.getDay();var firstDayOfWeek=this.getFirstDayOfWeek();var offset=firstDayInMonth-firstDayOfWeek+1;if(offset<0){offset=7+offset;}
curDate.setDate(curDate.getDate()-offset);this.synchroniseMonthYear(month,year);var dateMin=this.getMinDate();var dateMax=this.getMaxDate();var dayClass=this.getAttribute("odcCalendarDay");var dayDisabledClass="igDisabledCalendarDay";var daySelectedClass=this.getAttribute("oscCalendarDay");var dayHeaderClass=this.getAttribute("ocssdh");var dayNotCurrentMonthClass=this.getAttribute(ig.input.CSS_CALENDAR_DAY_NOT_CURRENT_MONTH);var body="<table>";if(this.getShowDayHeader()){body+="<thead class='"+dayHeaderClass+"'>";body+="<tr>";var weekDays=this.getDayList().split(",");var dayShow=parseInt(firstDayOfWeek)-1;for(var h=0;h<7;h++){body+="<td>"+weekDays[dayShow++]+"</td>";if(dayShow>=7){dayShow=0;}}
body+="</tr></thead>";}
this.setAttribute(ig.PROP_SELECTED_ELEMENT,"");body+="<tbody>";for(var i=0;i<6&&curDate.getMonth()!=ig.input.getNextMonthOfDate(this.getDisplayedDate());i++){body+="<tr>";for(j=0;j<7;j++){var calendarDayId=this.elm.id+"_"+(i*7+j);body+="<td otype='CalendarDay' id='"+calendarDayId+"' oDate='"+curDate.getTime()+"'";if(((dateMin!==null)&&(curDate<dateMin))||((dateMax!==null)&&(curDate>dateMax))){body+=" odsbld='true' class='"+dayClass+" "+dayDisabledClass+"'>"+curDate.getDate()+"</td>";}else{if(ig.isSameDay(selectedDate,curDate)){this.setAttribute(ig.PROP_SELECTED_ELEMENT,calendarDayId);body+=" class='"+daySelectedClass+"'><a href='#' onclick='return false;'>"+curDate.getDate()+"</a></td>";}else{if(curDate.getMonth()==month){body+=" class='"+dayClass+"'><a href='#' onclick='return false;'>"+curDate.getDate()+"</a></td>";}else{body+=" class='"+dayNotCurrentMonthClass+"'><a href='#' onclick='return false;'>"+curDate.getDate()+"</a></td>";}}}
curDate.setDate(curDate.getDate()+1);}
body+="</tr>";}
body+="<tr>";body+="<td colspan='7'></td>";body+="</tr>";body+="</tbody>";body+="</table>";var calBody=this.getBody();if(!ig.isNull(calBody)){calBody.innerHTML=body;}};IgCalendarPopup.prototype.populateMonthYear=function(month,year){var oMonth=this.getMonthCombo();if(!ig.isNull(oMonth)){oMonth.length=0;var months=this.getMonthList().split(",");if(!ig.isNull(months)){for(var i=0;i<months.length;i++){oMonth.options[i]=new Option(months[i]);}}}};IgCalendarPopup.prototype.onClick=function(evt){var flagValue=ig.getAttribute(evt.target,ig.PROP_FLAG);if(flagValue=="bpy"){this.showPreviousMonth();}
else if(flagValue=="bny"){this.showNextMonth();}};IgCalendarPopup.prototype.onKeyDown=function(evt){var flagValue=ig.getAttribute(evt.target,ig.PROP_FLAG);if(flagValue=="tbcy"){switch(evt.keyCode){case evt.KEY_UP:this.showNextYear();break;case evt.KEY_DOWN:this.showPreviousYear();break;case evt.KEY_RETURN:var dd=this.getDisplayedDate();var newYear=evt.target.value;this.showDate(dd.getMonth(),newYear);return false;break;}}};IgCalendarPopup.prototype.setDateChooser=function(parent){this.elm._dateChooser=parent;};IgCalendarPopup.prototype.show=function(parent){var p=ig.getUIElementById(parent);this.init(p);var pos=p.getPagePosition();this.setDateChooser(p.elm);this.rebuild();this.callSuper("IgPopup","show",pos.x,pos.y+p.getHeight());var sd=this.getSelectedElement();if(ig.isNull(sd)){var ahrefs=this.elm.getElementsByTagName("a");if(ig.isArray(ahrefs)){sd=ahrefs[0];}}
if(!ig.isNull(sd)){sd.focus();}};IgCalendarPopup.prototype.showDate=function(month,year){if(!isNaN(month)&&!isNaN(year)){var oDate=new Date(year,month,"01");this.setDisplayedDate(oDate);this.rebuild();}};ig.augment(IgCalendarPopup,IgPopup);ig.augment(IgCalendarPopup,IgCalendar);function IgInput(e){this.IgUIComponent(e);};ig.augment(IgInput,IgUIComponent);ig.addEventListener(window,"load",ig.input.init,false);}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -