123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933 |
- XFormsGroup.prototype = new XFormsBindableControl;
- function XFormsGroup (strParentId, strAlert, strHelp, strHint, strAccesskey, strBind, strClass, bDisabled, strId, nNavindex,
- strOverflow, bPopup, strRef, strScroll, strShowEffect, strStyle, strTag, strVisibility, strUserDefineAttrib)
- {
- if (!strId)
- {
- return;
- }
-
- XFormsBindableControl.call(this, strParentId, strAlert, strHelp, strHint, strAccesskey, strBind,
- strClass, bDisabled, strId, nNavindex, strRef, strStyle, strTag, strVisibility, strUserDefineAttrib);
-
- this.m_winPopup = null;
- this.m_bApplyPadding = false;
-
- /**
- * Attribute
- */
- this.attribute["overflow"] = strOverflow;
- this.attribute["popup"] = String(bPopup);
- this.attribute["scroll"] = strScroll;
- this.attribute["showeffect"] = strShowEffect;
-
- this.m_nSelectedRow = -1;
- this.m_nSelectedCol = -1;
- this.m_bScoll = false;
-
- // SmartPhone
- if (is_smartphone)
- {
- this.bIsExpansion = false;
- }
- };
- XFormsGroup.prototype.init = function ()
- {
- XFormsBindableControl.prototype.init.call(this);
-
- this.vscroll = new XFormsScrollBar(this.id, this.id + "_vscroll", "xforms:scrollbar", "vscroll", -1 != this.attribute["tag"].indexOf("datagrid"));
- this.hscroll = new XFormsScrollBar(this.id, this.id + "_hscroll", "xforms:scrollbar", "hscroll", -1 != this.attribute["tag"].indexOf("datagrid"));
-
- if (null != this.m_heControl)
- {
- this.setAttribute("overflow", this.attribute["overflow"]);
- if("scroll" == this.attribute["overflow"])
- {
- this.setScroll(this.attribute["scroll"]);
- }
-
- // DataGrid의 자식이냐?
- var bIsDataGrid = false;
- var objParent = this;
- while ("xhtml:body" != objParent.elementName)
- {
- if ("xforms:datagrid" == objParent.elementName)
- {
- bIsDataGrid = true;
- break;
- }
- objParent = objParent.parent;
- }
- // if (!bIsDataGrid)
- // {
- // this.overflow();
- // }
- }
-
- // 스마트폰 확장 버튼
- if (is_smartphone)
- {
- // Treeview 원래 크기 저장해두기.
- if (null != this.m_heControl)
- {
- this.m_nOriginWidth = this.m_heControl.offsetWidth;
- this.m_nOriginHeight = this.m_heControl.offsetHeight;
- var strElementName = this.elementName;
- if ("xforms:group" == strElementName)
- {
- this.makeGroupExpansion();
- }
- }
- }
- this.resizeControl();
- };
- XFormsGroup.prototype.applyDefaultStyle = function()
- {
- XFormsBindableControl.prototype.applyDefaultStyle.call(this);
-
- if (!this.attribute["background-color"])
- {
- this.m_heControl.style.backgroundColor = "#FFFFFF";
- }
- };
- XFormsGroup.prototype.getAbility = function ()
- {
- return EA_GROUP;
- };
- XFormsGroup.prototype.getPopup = function ()
- {
- return this.m_winPopup;
- };
- XFormsGroup.prototype.isApplyPadding = function ()
- {
- return this.m_bApplyPadding;
- };
- XFormsGroup.prototype.setApplyPadding = function (bApplyPadding)
- {
- this.m_bApplyPadding = bApplyPadding;
- };
- /**
- * ************ Method ************
- */
- XFormsGroup.prototype.refresh = function ()
- {
- XFormsBindableControl.prototype.refresh.call(this);
-
- var arKeyset = this.children.keys();
- for (var i=0; i<arKeyset.length; i++)
- {
- var strId = arKeyset[i];
- var objChild = this.children.item(strId);
-
- if (null != objChild && objChild instanceof XFormsElement && objChild.refresh)
- {
- objChild.refresh();
- }
- }
- };
- /**
- * *********** property ***********
- */
- /**
- * Attribute 값을 변경시키고 Attribute 값 변화에 맞는 동작을 수행한다.
- * @param strAttribute
- * @param strValue
- * @return
- */
- XFormsGroup.prototype.setAttribute = function (strAttribute, strValue)
- {
- XFormsBindableControl.prototype.setAttribute.call(this, strAttribute, strValue);
- switch (strAttribute)
- {
- case "overflow" :
- {
- this.attribute["overflow"] = strValue;
- this.setOverflow(strValue);
- break;
- }
- case "scroll" :
- {
- this.attribute["scroll"] = strValue;
- this.setScroll(strValue);
- break;
- }
- }
- };
- XFormsGroup.prototype.setScroll = function(strScroll)
- {
- switch (strScroll)
- {
- case "vertical" :
- {
- this.m_heControl.style.overflowX = "hidden";
- this.m_heControl.style.overflowY = "scroll";
- break;
- }
- case "horizontal" :
- {
- this.m_heControl.style.overflowX = "scroll";
- this.m_heControl.style.overflowY = "hidden";
- break;
- }
- case "both" :
- {
- this.m_heControl.style.overflowX = "scroll";
- this.m_heControl.style.overflowY = "scroll";
- break;
- }
- case "autovscroll" :
- {
- this.m_heControl.style.overflowX = "hidden";
- this.m_heControl.style.overflowY = "auto";
- break;
- }
- case "autohscroll" :
- {
- this.m_heControl.style.overflowX = "auto";
- this.m_heControl.style.overflowY = "hidden";
- break;
- }
- case "none" :
- {
- this.m_heControl.style.overflowX = "visible";
- this.m_heControl.style.overflowY = "visible";
- break;
- }
- default :
- {
- this.m_heControl.style.overflowX = "auto";
- this.m_heControl.style.overflowY = "auto";
- break;
- }
- }
- };
- XFormsGroup.prototype.setOverflow = function(strOverflow)
- {
- switch (strOverflow)
- {
- case "visible" :
- {
- this.m_heControl.style.overflowX = "visible";
- this.m_heControl.style.overflowY = "visible";
- break;
- }
- case "hidden" :
- {
- this.m_heControl.style.overflowX = "hidden";
- this.m_heControl.style.overflowY = "hidden";
- break;
- }
- case "scroll" :
- {
- this.m_heControl.style.overflowX = "auto";
- this.m_heControl.style.overflowY = "auto";
- break;
- }
- default :
- {
- break;
- }
- }
- };
- XFormsGroup.prototype.overflow = function ()
- {
- // 자신의 위치와 크기
- var nOffsetRight = 0;
- var nOffsetBottom = 0;
-
- var objParent = this;
- var bIsDatagrid = false;
- while("xhtml:body" != objParent.elementName)
- {
- if (null != objParent.m_heControl)
- {
- nOffsetRight += objParent.m_heControl.offsetLeft;
- nOffsetBottom += objParent.m_heControl.offsetTop;
- }
-
- objParent = objParent.parent;
- }
- nOffsetRight += this.m_heControl.offsetWidth;
- nOffsetBottom += this.m_heControl.offsetHeight;
-
- objParent = this.parent;
- // objParent가 xhtml:body일때 return
- if ("xhtml:html" == objParent.elementName)
- {
- return;
- }
-
- var nParentOffsetRight = 0;
- var nParentOffsetBottom = 0;
-
- while ("xhtml:body" != objParent.elementName)
- {
- if ("xforms:group" == objParent.elementName && ("visible" == objParent.getAttribute("overflow")))
- {
- if (null != objParent.m_heControl)
- {
- // 부모의 offset 크기
- nParentOffsetRight = objParent.m_heControl.offsetLeft + objParent.m_heControl.offsetWidth;
- nParentOffsetRight = objParent.m_heControl.offsetTop + objParent.m_heControl.offsetHeight;
-
- var nFinalOffsetRight = (nOffsetRight > nParentOffsetRight) ? nOffsetRight : nParentOffsetRight ;
- var nFinalOffsetBottom = (nOffsetBottom > nParentOffsetBottom) ? nOffsetBottom : nParentOffsetBottom;
-
- objParent.setAttribute("width", nFinalOffsetRight - objParent.m_heControl.offsetLeft);
- objParent.setAttribute("height", nFinalOffsetBottom - objParent.m_heControl.offsetTop);
- }
- }
- objParent = objParent.parent;
- }
- };
- /**
- * ID가 strId인 컨트롤의 obj를 반환한다. 존재하지 않을 경우 null를 반환
- * @param strId 컨트롤의 ID
- * @return
- */
- XFormsGroup.prototype.childReturnObj = function (strId)
- {
- var objChild = this.children.item(strId);
- if (null != objChild)
- {
- return objChild;
- }
- else
- {
- return null;
- }
- };
- /**
- * ID가 strId인 컨트롤이 Switch의 자식인지 판단한다.
- * @param strId 컨트롤의 ID
- * @return
- */
- XFormsGroup.prototype.isChild = function (strId)
- {
- var objChild = this.children.item(strId);
- if (null != objChild)
- {
- return true;
- }
- else
- {
- return false;
- }
- };
- /**
- * ID가 strId인 컨트롤이 Switch의 자손인지 판단한다.
- * @param strId 컨트롤의 ID
- * @param bIncludeThis Switch 자신을 포함할지 여부
- * @return
- */
- XFormsGroup.prototype.isDescendants = function (strId, bIncludeThis)
- {
- if (null == bIncludeThis)
- {
- bIncludeThis = false;
- }
-
- var objChild = document.allElement.item(strId);
-
- if (null != objChild)
- {
- if (true == bIncludeThis)
- {
- if (objChild == this)
- {
- return true;
- }
- }
-
- var objParent = objChild.parent;
- while (null != objParent)
- {
- if (objParent == this)
- {
- return true;
- }
- objParent = objParent.parent;
- }
-
- return false;
- }
- return false;
- };
- XFormsGroup.prototype.setSelectedRow = function (nRow)
- {
- this.m_nSelectedRow = nRow;
- this.attribute["row"] = nRow;
- };
- XFormsGroup.prototype.setSelectedCol = function (nCol)
- {
- this.m_nSelectedCol = nCol;
- this.attribute["col"] = nCol;
- };
- XFormsGroup.prototype.getCellById = function (strCellId)
- {
- return document.allElement.item(strCellId);
- };
- XFormsGroup.prototype.getCell = function (nRow, nCol)
- {
- var strCellId = this.id + "_" + nRow + "_" + nCol;
- return document.allElement.item(strCellId);
- };
- XFormsGroup.prototype.isCell = function (strId)
- {
- var objElement = document.allElement.item(strId);
- if (null != objElement)
- {
- return (this == objElement.parent);
- }
- return false;
- };
- XFormsGroup.prototype.isScrollBar = function (event)
- {
- var nXPos = this.getClientLeft() + this.m_heControl.offsetWidth;
- var nYPos = this.getClientTop() + this.m_heControl.offsetHeight;
-
- if (this._isVScroll() && nXPos - 15 <= event.clientX && event.clientX <= nXPos)
- {
- return true;
- }
-
- if (this._isHScroll() && nYPos - 15 <= event.clientY && event.clientY <= nYPos)
- {
- return true;
- }
-
- return false;
- };
- XFormsGroup.prototype.isDragCellSelect = function (nRow, nCol, objCell)
- {
- if (objCell.getSelect())
- {
- var rectCell = this.getCellContentRect (nRow, nCol);
- if ((rectCell.getBottom() - 6) <= m_event.y)
- {
- return true;
- }
- }
- return false;
- };
- /**
- * 종스크롤이 생겼는지 판단한다.
- * @return
- */
- XFormsGroup.prototype._isVScroll = function ()
- {
- return this.m_heControl.clientHeight < this.m_heControl.scrollHeight;
- };
- /**
- * 횡스크롤이 생겼는지 판단한다.
- * @return
- */
- XFormsGroup.prototype._isHScroll = function ()
- {
- return this.m_heControl.clientWidth < this.m_heControl.scrollWidth;
- };
- XFormsGroup.prototype.getMouseRow = function ()
- {
- return this.getAttribute("row");
- };
- XFormsGroup.prototype.setMouseRow = function (nRow)
- {
- this.setAttribute("row", nRow);
- };
- XFormsGroup.prototype.getMouseCol = function ()
- {
- return this.getAttribute("col");
- };
- XFormsGroup.prototype.setMouseCol = function (nCol)
- {
- this.setAttribute("col", nCol);
- };
- XFormsGroup.create = function (strParentId, clAttribute, strStyle)
- {
- // 메인노드 생성
- var xnGroup = XFormsGroup.createMainNode(clAttribute);
- var xnParent = document.getElementById("HE_"+strParentId);
- xnParent.appendChild(xnGroup);
- // 하위노드 생성
- xnGroup = XFormsGroup.createSubNodes(xnGroup, clAttribute);
- // object 생성
- return XFormsGroup.createObject(strParentId, xnGroup, clAttribute, strStyle);
- };
- XFormsGroup.createMainNode = function (clAttribute)
- {
- var xnGroup = document.createElement("div");
- xnGroup = XFormsGroup.createAttribute(xnGroup, clAttribute);
- return xnGroup;
- };
- XFormsGroup.createSubNodes = function (xnGroup, clAttribute)
- {
- return xnGroup;
- };
- XFormsGroup.createObject = function (strParentId, xnGroup, clAttribute, strStyle)
- {
- var strAlert = "";
- var strHelp = "";
- var strHint = "";
- var strAccesskey = "";
- var strBind = "";
- var strClass = "";
- var bDisabled = false;
- var strId = "";
- var nNavindex = 9007199254740992;
- var strOverFlow = "scroll";
- var bPopup = false;
- var strRef = "";
- var strScroll = "auto";
- var strShowEffect = "blend 300";
- var strVisibility = "visible";
- var strUserDefineAttrib = "";
-
- for (var i=0; i<clAttribute.count(); i++)
- {
- var strAttributeName = clAttribute.keys()[i];
- switch (strAttributeName)
- {
- case "alert" :
- {
- strAlert = clAttribute.item(strAttributeName);
- break;
- }
- case "help" :
- {
- strHelp = clAttribute.item(strAttributeName);
- break;
- }
- case "hint" :
- {
- strHint = clAttribute.item(strAttributeName);
- break;
- }
- case "accesskey" :
- {
- strAccesskey = clAttribute.item(strAttributeName);
- break;
- }
- case "bind" :
- {
- strBind = clAttribute.item(strAttributeName);
- }
- case "class" :
- {
- strClass = clAttribute.item(strAttributeName);
- break;
- }
- case "disabled" :
- {
- if ("true" == clAttribute.item(strAttributeName))
- {
- bDisabled = true;
- }
- break;
- }
- case "id" :
- {
- strId = clAttribute.item(strAttributeName);
- break;
- }
- case "navindex" :
- {
- nNavindex = parseInt(clAttribute.item(strAttributeName));
- break;
- }
- case "overflow" :
- {
- strOverFlow = clAttribute.item(strAttributeName);
- break;
- }
- case "popup" :
- {
- if ("true" == clAttribute.item(strAttributeName))
- {
- bPopup = true;
- }
- break;
- }
- case "ref" :
- {
- strRef = clAttribute.item(strAttributeName);
- break;
- }
- case "scroll" :
- {
- strScroll = clAttribute.item(strAttributeName);
- break;
- }
- case "showeffect" :
- {
- strShowEffect = clAttribute.item(strAttributeName);
- break;
- }
- case "visibility" :
- {
- strVisibility = clAttribute.item(strAttributeName);
- break;
- }
-
- default :
- {
- if (!STYLE_LIST[strAttributeName])
- {
- strUserDefineAttrib += strAttributeName + ":" + clAttribute.item(strAttributeName) + "; ";
- }
- break;
- }
- }
- }
- var objGroup = new XFormsGroup (strParentId, strAlert, strHelp, strHint, strAccesskey, strBind, strClass, bDisabled, strId, nNavindex, strOverFlow, bPopup, strRef, strScroll, strShowEffect, strStyle, "xforms:group", strVisibility, strUserDefineAttrib);
- return objGroup;
- };
- XFormsGroup.createAttribute = function (xnHtmlNode, clAttribute)
- {
- xnHtmlNode = XFormsBindableControl.createAttribute(xnHtmlNode, clAttribute);
- return xnHtmlNode;
- };
- // TODO 2010. 11. 29. SmartPhone 작업
- //smartphone에서 확장/축소 버튼 그리기
- XFormsGroup.prototype.makeGroupExpansion = function ()
- {
- var heExpansionButton = document.getElementById("__GROUP_EXPANSION_" + this.id);
- if (null == heExpansionButton)
- {
- heExpansionButton = document.createElement("image");
- heExpansionButton.setAttribute("onclick", "XFormsGroup.onClickExpansion(event, \""+this.id+"\")");
-
- heExpansionButton.setAttribute("id", "__GROUP_EXPANSION_" + this.id);
- heExpansionButton.setAttribute("src", __getAppName() + "/kr/comsquare/image/global/buttonExpansion.png");
- heExpansionButton.style.position = "absolute";
-
- heExpansionButton.style.top = (this.m_heControl.offsetTop + this.m_heControl.offsetHeight - 20) + "px";
- heExpansionButton.style.left = (this.m_heControl.offsetLeft + this.m_heControl.offsetWidth - 20) + "px";
-
- if ("visible" == this.getAttribute("overflow") || "hidden" == this.getAttribute("overflow"))
- {
- heExpansionButton.style.display = "none";
- }
-
- document.body.appendChild(heExpansionButton);
- }
- };
- XFormsGroup.prototype.getOffsetLeft = function ()
- {
- var strElementName = this.elementName;
- var objParent = this;
- var nLeft = 0;
-
- while ("xhtml:body" != strElementName)
- {
- nLeft += objParent.m_heControl.offsetLeft;
-
- objParent = objParent.parent;
- strElementName = objParent.elementName;
- }
-
- return nLeft;
- };
- XFormsGroup.prototype.getOffsetTop = function ()
- {
- var strElementName = this.elementName;
- var objParent = this;
- var nTop = 0;
-
- while ("xhtml:body" != strElementName)
- {
- nTop += objParent.m_heControl.offsetTop;
-
- objParent = objParent.parent;
- strElementName = objParent.elementName;
- }
-
- return nTop;
- };
- /**
- * 스마트폰 브라우저 상에서 그룹 확장/되돌림 버튼 위치를 조정한다.
- *
- * @return
- */
- XFormsGroup.prototype.moveGroupExpansion = function ()
- {
- if (is_smartphone)
- {
- if (this.bIsExpansion)
- {
- var heElementExpansion = document.getElementById("__GROUP_EXPANSION_" + this.id);
- if (null != heElementExpansion)
- {
- var nGroupEndXPosition = this.getOffsetLeft() + this.m_heControl.offsetWidth;
- var nGroupEndYPosition = this.getOffsetTop() + this.m_heControl.offsetHeight;
- var nScreenEndXPosition = window.scrollX + window.innerWidth;
- var nScreenEndYPosition = window.scrollY + window.innerHeight;
- var nGroupXPosition = this.m_heControl.offsetLeft;
- var nGroupYPosition = this.m_heControl.offsetTop;
-
- var nXPos = (nGroupEndXPosition > nScreenEndXPosition) ? nScreenEndXPosition : nGroupEndXPosition;
- var nYPos = (nGroupEndYPosition > nScreenEndYPosition) ? nScreenEndYPosition : nGroupEndYPosition;
- nXPos = (nGroupXPosition < nXPos) ? nXPos : nGroupXPosition;
- nYPos = (nGroupYPosition < nYPos) ? nYPos : nGroupYPosition;
- heElementExpansion.style.top = (nYPos - 20) + "px";
- heElementExpansion.style.left = (nXPos - 20) + "px";
- }
- }
- }
- };
- //
- //// Group 전체 크기 다시 그리기(DIV)
- //XFormsGroup.prototype.wholeSize = function ()
- //{
- // if (is_smartphone)
- // {
- // var objParent = this.parent;
- // var strElementName = objParent.elementName;
- // while ("xhtml:body" != strElementName)
- // {
- // if ("xforms:group" == strElementName ||
- // "xforms:switch" == strElementName)
- // {
- // if (objParent.bIsExpansion)
- // {
- // // 부모의 offset Right, Bottom을 구한다
- // var nParentRight = objParent.getOffsetLeft() + objParent.m_heControl.offsetWidth;
- // var nParentBottom = objParent.getOffsetTop() + objParent.m_heControl.offsetHeight;
- //
- // var nFinalRight = 0;
- // var nFinalBottom = 0;
- //
- // var objChildren = objParent.children;
- // for (var i=0; i<objChildren.length; i++)
- // {
- // var objChild = objChildren.item(i);
- // var nRight = 0;
- // var nBottom = 0;
- // if (objChild instanceof XFormsGroup)
- // {
- // nRight = objChild.getOffsetLeft() + objChild.m_heControl.offsetWidth;
- // nBottom = objChild.getOffsetTop() + objChild.m_heControl.offsetHeight;
- // }
- // else
- // {
- // nRight = objChild.getClientLeft(false) + objChild.m_heControl.offsetWidth;
- // nBottom = objChild.getClientTop(false) + objChild.m_heControl.offsetHeight;
- // }
- //
- // nFinalRight = (nFinalRight > nRight) ? nFinalRight : nRight;
- // nFinalBottom = (nFinalBottom > nBottom) ? nFinalBottom : nBottom;
- // }
- // objParent.m_heControl.style.width = nFinalRight - objParent.getOffsetLeft();
- // objParent.m_heControl.style.height = nFinalBottom - objParent.getOffsetTop();
- // }
- //
- // }
- // objParent.moveExpansion();
- // objParent = objParent.parent;
- // strElementName = objParent.elementName;
- // }
- // this.moveExpansion();
- // }
- //};
- //
- /**
- * 전역함수
- */
- XFormsGroup.onClickExpansion = function (event, strId)
- {
- var objGroup = document.allElement.item(strId);
- var heElementGroup = document.getElementById("HE_" + strId);
- var heElementExpansion = document.getElementById("__GROUP_EXPANSION_" + strId);
-
- if (null != heElementGroup)
- {
- if (!objGroup.bIsExpansion)
- {
- var scrollWidth = (objGroup.m_nOriginWidth > heElementGroup.scrollWidth) ? objGroup.m_nOriginWidth : heElementGroup.scrollWidth;
- var scrollHeight = (objGroup.m_nOriginHeight > heElementGroup.scrollHeight) ? objGroup.m_nOriginHeight : heElementGroup.scrollHeight;
- heElementGroup.style.width = scrollWidth + "px";
- heElementGroup.style.height = scrollHeight + "px";
-
- objGroup.setAttribute("overflow", "visible");
- objGroup.bIsExpansion = true;
- heElementExpansion.src = __getAppName() + "/kr/comsquare/image/global/buttonReturn.png";
-
-
- // 브라우저 Screen 마지막 x,y 좌표
- var nScreenEndXPosition = window.scrollX + window.innerWidth;
- var nScreenEndYPosition = window.scrollY + window.innerHeight;
-
- // Group 마지막 x,y 좌표
- var nGroupEndXPosition = objGroup.m_heControl.offsetLeft + heElementGroup.offsetWidth;
- var nGroupEndYPosition = objGroup.m_heControl.offsetTop + heElementGroup.offsetHeight;
-
- // 마지막 좌표 구하기
- var nXPos = ((nGroupEndXPosition > nScreenEndXPosition) ? nScreenEndXPosition : nGroupEndXPosition);
- var nYPos = ((nGroupEndYPosition > nScreenEndYPosition) ? nScreenEndYPosition : nGroupEndYPosition);
-
- heElementExpansion.style.left = ((nXPos - 20) < 0) ? "0px" : (nXPos - 20) + "px";
- heElementExpansion.style.top = ((nYPos - 20) < 0) ? "0px" : (nYPos - 20) + "px";
- }
- else
- {
- heElementGroup.style.width = objGroup.m_nOriginWidth + "px";
- heElementGroup.style.height = objGroup.m_nOriginHeight + "px";
-
- objGroup.setAttribute("overflow", "hidden");
- objGroup.bIsExpansion = false;
- heElementExpansion.src = __getAppName() + "/kr/comsquare/image/global/buttonExpansion.png";
-
- heElementExpansion.style.left = (objGroup.m_heControl.offsetLeft + heElementGroup.offsetWidth - 20) + "px";
- heElementExpansion.style.top = (objGroup.m_heControl.offsetTop + heElementGroup.offsetHeight - 20) + "px";
- }
- }
- };
- /**
- * 스크롤바의 객체를 만든다
- */
- XFormsScrollBar.prototype = new XFormsAttribute;
- function XFormsScrollBar (strParentId, strId, strTag, strType, bIsGrid)
- {
- if (!strParentId)
- {
- return;
- }
- XFormsAttribute.call(this, strParentId, strId, strTag);
- this.attribute["min"] = "0";
- this.attribute["max"] = "0";
- this.attribute["pos"] = "0";
-
- this.is_bGrid = bIsGrid;
- this.m_strType = strType;
- this.m_targetControl = null;
- };
- XFormsScrollBar.prototype.init = function ()
- {
- if (null != this.parent)
- {
- if (null != this.parent.m_heControl)
- {
-
- if (!this.is_bGrid)
- {
- this.m_targetControl = this.parent.m_heControl;
- }
- else
- {
- this.m_targetControl = document.getElementById("HE__DATAGRID_WHOLE_" + this.parent.id);
- }
- if (null != this.m_targetControl)
- {
- if ("vscroll" == this.m_strType)
- {
- this.attribute["max"] = parseInt(this.m_targetControl.scrollHeight - this.m_targetControl.offsetHeight);
- this.attribute["pos"] = parseInt(this.m_targetControl.scrollTop);
- }
- else
- {
- this.attribute["max"] = parseInt(this.m_targetControl.scrollWidth - this.m_targetControl.offsetWidth);
- this.attribute["pos"] = parseInt(this.m_targetControl.scrollLeft);
- }
- }
- }
- }
- };
- XFormsScrollBar.prototype.setAttribute = function (strAttribute, strValue)
- {
- switch (strAttribute)
- {
- case "pos" :
- {
- this.attribute["pos"] = strValue;
- if (null != this.m_targetControl)
- {
- if ("vscroll" == this.m_strType)
- {
- this.m_targetControl.scrollTop = parseInt(strValue);
- }
- else
- {
- this.m_targetControl.scrollLeft = parseInt(strValue);
- }
- }
- break;
- }
- }
- };
- XFormsScrollBar.prototype.refresh = function ()
- {
- if (null == this.m_targetControl)
- {
- this.init();
- return;
- }
- if (null != this.m_targetControl)
- {
- if ("vscroll" == this.m_strType)
- {
- this.attribute["max"] = parseInt(this.m_targetControl.scrollHeight - this.m_targetControl.offsetHeight);
- this.attribute["pos"] = parseInt(this.m_targetControl.scrollTop);
- }
- else
- {
- this.attribute["max"] = parseInt(this.m_targetControl.scrollWidth - this.m_targetControl.offsetWidth);
- this.attribute["pos"] = parseInt(this.m_targetControl.scrollLeft);
- }
- }
- };
|