123456 |
- // Licensed Materials - Property of IBM
- // IBM Cognos Products: cchl
- // (C) Copyright IBM Corp. 2003, 2016.
- // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- function C_ListViewConditional(_cK4, _cCB1, _cLR, _cMR, _cEA){G_HAL.F_VerifyDependencies("G_ResManager");this._cL4=_cK4;this._cL4._cZ6=this;this._cDB1=_cCB1?_cCB1:null;this._c071=null;this._cNR=_cLR?_cLR:G_ResManager.F_GetString("IDS_CCHL_MSG_TEXT_CONDITION");this._cOR=_cMR?_cMR:G_ResManager.F_GetString("IDS_CCHL_MSG_STYLE");this._cFA=_cEA?_cEA:false;};C_ListViewConditional.prototype.F_Detach=function(){this.F_RemoveAllRows();var _c0C1=this._cL4.childNodes[ 0 ];var _c3L1=this._cL4.childNodes[ 1 ];this._cL4.removeChild(_c0C1);this._cL4.removeChild(_c3L1);this._cL4._cZ6=null;};C_ListViewConditional.prototype.F_SetFirstColumnWidth=function(_c171){this._cUC=_c171;};C_ListViewConditional.prototype.F_Draw=function(){this._cL4.style.height="200px";this._cL4.className="clsListView";this._cL4.style.overflow="hidden";var _c0C1=this._cL4.appendChild(document.createElement("table"));U_Accessibility.F_SetRoleForLayoutTable(_c0C1);this._cPR(_c0C1);var _cQ11=this._cL4.appendChild(document.createElement("div"));_cQ11.style.height=this._cL4.clientHeight-_c0C1.offsetHeight+"px";_cQ11.style.width="100%";_cQ11.style.overflow="auto";_cQ11.style.verticalAlign="top";this._cM4=_cQ11.appendChild(document.createElement("table"));this._cM4.className="clsDialogText";this._cM4.style.width="100%";this._cM4.setAttribute( "border", "0" );this._cM4.setAttribute( "cellSpacing", "0" );this._cM4.setAttribute( "cellPadding", "0" );this._cM4.style.borderCollapse="collapse";U_Accessibility.F_SetRoleForLayoutTable(this._cM4);};C_ListViewConditional.prototype._cPR=function(_c2V1){_c2V1.className="clsDialogText";_c2V1.style.width="100%";_c2V1.setAttribute( "border", "0" );_c2V1.setAttribute( "cellSpacing", "0" );_c2V1.setAttribute( "cellPadding", "0" );var _cMV1=_c2V1.insertRow(0);_cMV1.className="clsCCHLtableHeader";this._cVC=_cMV1.insertCell(0);this._cVC.style.width=this._cUC||(this._cL4.clientWidth-240+"px");this._cPM(this._cVC, this._cNR);var _cN4=_cMV1.insertCell(1);this._cPM(_cN4, this._cOR);};C_ListViewConditional.prototype._cPM=function(_cNV1,_cQN1){var _c3V1=_cNV1.appendChild(document.createElement("div"));_c3V1.className="clsListViewColumnHeader";_c3V1.innerHTML=_cQN1;};C_ListViewConditional.prototype.F_InsertRow=function(_cQM,_cBO1,_c271){if(typeof _cBO1=="undefined"){_cBO1=((this._cM4.rows.length)<2)?this._cM4.rows.length:(this._cM4.rows.length-1);}var _cMV1=this._cM4.insertRow(_cBO1);_cMV1.className="clsListItem_normal";var _cNV1=_cMV1.insertCell(0);_cNV1.className="clsListItem_gridLine";_cNV1.style.width=this._cVC.clientWidth-1+"px";_cNV1.onmousedown=C_ListViewConditional._c07;_cNV1.ondblclick=C_ListViewConditional._cJ8;_cNV1.id=this._cL4.id+"_idx_" + this._cM4.rows.length; var _cGW=_cNV1.appendChild(document.createElement("div"));_cGW.style.textOverflow="ellipsis";_cGW.style.overflow="hidden";_cGW.style.whiteSpace="nowrap";_cGW.style.margin="2px 5px 2px 5px";_cGW.style.width=this._cVC.clientWidth-11+"px";if(_c271){var _cHW=_cGW.appendChild(document.createElement("img"));_cHW.src=G_HAL.F_GetImageURL(_c271);_cHW.style.margin="1px 2px 1px 1px";_cHW.style.height="16px";_cHW.style.width="16px";_cHW.style.verticalAlign="middle";}var _c1C1=_cGW.appendChild(document.createElement("span"));_c1C1.style.paddingLeft="2px";_c1C1.style.verticalAlign="middle";_c1C1.innerText=_cQM;if(G_HAL.M_oLibraries["hal"]["enableAccessibility"]){_cGW.tabIndex=0;_cGW.setAttribute( "aria-labelledby", ( this._cVC.uniqueID + " " + _c1C1.uniqueID ) );}_cMV1._cRM=_cQM;var _c0G=_cMV1.insertCell(1);_c0G.className="clsListItem_gridLine";var _cWC=_c0G.appendChild(document.createElement("div"));_cWC.style.overflow="hidden";_cWC.style.whiteSpace="nowrap";_cWC.style.margin="2px 5px 2px 5px";if(this._cDB1&&this._cDB1.F_ListViewConditional_OnAddNewRow){var _cXC=_cWC.appendChild(document.createElement("table"));_cXC.setAttribute( "border", "0" );_cXC.setAttribute( "cellSpacing", "0" );_cXC.setAttribute( "cellPadding", "0" );_cXC.id=this._cL4.id+"_idx_" + this._cM4.rows.length + "_tbl"; U_Accessibility.F_SetRoleForLayoutTable(_cXC);var _cYC=this._cDB1.F_ListViewConditional_OnAddNewRow(_cXC);_cMV1._cZC=_cYC;}};C_ListViewConditional.prototype.F_RemoveSelectedRow=function(){if(!this._c071){return;}if(this._cDB1&&this._cDB1.F_ListViewConditional_OnRemoveRow){this._cDB1.F_ListViewConditional_OnRemoveRow(this._c071.parentNode._cZC);}this._c071.parentNode.parentNode.removeChild(this._c071.parentNode);this._c071=null;};C_ListViewConditional.prototype.F_RemoveAllRows=function(){var _c2C1=this.F_GetRowCount();for(var i=0;i<_c2C1;i++){var _cMV1=this._cM4.rows.item(0);if(this._cDB1&&this._cDB1.F_ListViewConditional_OnRemoveRow){this._cDB1.F_ListViewConditional_OnRemoveRow(_cMV1._cZC);}_cMV1.parentNode.removeChild(_cMV1);}this._c071=null;};C_ListViewConditional._c07=function(e){ if(G_HAL.M_oTestListener&&G_HAL.M_oTestListener.F_TestListener_ElementOnMouseDown){G_HAL.M_oTestListener.F_TestListener_ElementOnMouseDown(e);}e.stopPropagation();var _cQA1=this.parentNode.parentNode.parentNode.parentNode.parentNode._cZ6;if((this.parentNode.rowIndex+1)==this.parentNode.parentNode.rows.length&&!_cQA1._cFA){return;}_cQA1._c3C1(this);if(_cQA1._cDB1&&_cQA1._cDB1.F_ListViewConditional_OnItemClick){_cQA1._cDB1.F_ListViewConditional_OnItemClick(this.parentNode.rowIndex);}};C_ListViewConditional._cJ8=function(e){ if(G_HAL.M_oTestListener&&G_HAL.M_oTestListener.F_TestListener_ElementOnMouseDown){G_HAL.M_oTestListener.F_TestListener_ElementOnMouseDown(e);}e.stopPropagation();var _cQA1=this.parentNode.parentNode.parentNode.parentNode.parentNode._cZ6;if((this.parentNode.rowIndex+1)==this.parentNode.parentNode.rows.length&&!_cQA1._cFA){return;}_cQA1._c3C1(this);if(_cQA1._cDB1&&_cQA1._cDB1.F_ListViewConditional_OnItemDblClick){_cQA1._cDB1.F_ListViewConditional_OnItemDblClick(this.parentNode.rowIndex);}};C_ListViewConditional.prototype._c3C1=function(_cCO1){if(this._c071==_cCO1){return;}if(this._c071){this._c071.className="clsListItem_gridLine";}_cCO1.className += " clsListItem_selected";this._c071=_cCO1;};C_ListViewConditional.prototype.F_MoveSelectedRowUp=function(){if(!this._c071){return;}var _c371=this._c071.parentNode;var _c9H1=this._c071.parentNode.previousSibling;if(_c9H1){_c371.parentNode.insertBefore(_c371, _c9H1);}};C_ListViewConditional.prototype.F_MoveSelectedRowDown=function(){if(!this._c071){return;}var _c371=this._c071.parentNode;var _c9H1=this._c071.parentNode.nextSibling;if(_c9H1){_c371.parentNode.insertBefore(_c371, _c9H1.nextSibling);}};C_ListViewConditional.prototype.F_GetSelectedRowIndex=function(){if(!this._c071){return null;}return this._c071.parentNode.rowIndex;};C_ListViewConditional.prototype.F_GetRowCount=function(){if(!this._cM4.firstChild){return 0;}else{return this._cM4.firstChild.childNodes.length;}};C_ListViewConditional.prototype.F_GetSelectedProperty=function(){return this._c071.parentNode._cZC;};C_ListViewConditional.prototype.F_SelectRow=function(_cBO1,_c5V){var _c471=this._cM4.rows.item(_cBO1);if(_c471){this._c3C1(_c471.cells.item(0));if((_c5V===true)&&this._cDB1&&this._cDB1.F_ListViewConditional_OnItemClick){this._cDB1.F_ListViewConditional_OnItemClick(_cBO1);}}};C_ListViewConditional.prototype.F_UnselectRow=function(){if(this._c071){this._c071.className="clsListItem_gridLine";}this._c071=null;};C_ListViewConditional.prototype.F_SetCondition=function(_cBO1,_cQM){var _cMV1=this._cM4.rows.item(_cBO1);if(_cMV1){_cMV1._cRM=_cQM;var _c3V1=_cMV1.cells.item(0).firstChild;_c3V1.innerText=_cQM;}};C_ListViewConditional.prototype.F_GetConditionValues=function(){var _cR11=[];for(var i=0;i<this.F_GetRowCount();i++){var _cMV1=this._cM4.rows.item(i);_cR11.push(new C_Condition(_cMV1._cRM, _cMV1._cZC));}return _cR11;};C_ListViewConditional.prototype.F_HideRowAtIndex=function(_cBO1){var tr=this._cM4.rows.item(_cBO1);tr.style.display="none";};C_ListViewConditional.prototype.F_ShowHiddenRowAtIndex=function(_cBO1){var tr=this._cM4.rows.item(_cBO1);tr.style.display="";};C_ListViewConditional.prototype.F_ShowAllHiddenRows=function(){var _cDO1=this.F_GetRowCount();for(var i=0; i<_cDO1; i++){this.F_ShowHiddenRowAtIndex(i);}};
|