ExpandMemberAction.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2001, 2011
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or
  8. *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *|
  10. *+------------------------------------------------------------------------+
  11. */
  12. function ExpandMemberAction()
  13. {
  14. this.m_sAction = "ExpandCollapseMember";
  15. this.m_sExpandCollapseType="ExpandMember";
  16. }
  17. ExpandMemberAction.prototype = new ExpandCollapseMemberAction();
  18. ExpandMemberAction.baseclass = ExpandCollapseMemberAction.prototype;
  19. ExpandMemberAction.prototype.getUndoHint = function()
  20. {
  21. return RV_RES.IDS_JS_EXPAND_MEMBER;
  22. };
  23. ExpandMemberAction.prototype._canEnableMenu = function(oSectionController)
  24. {
  25. if (!this._isSingleSelection(oSectionController)) {
  26. return false;
  27. }
  28. var selObj = this._getFirstSelectedObject(oSectionController);
  29. if (this._alwaysCanExpandCollapse(selObj)) {
  30. //Always enable both expand/collapse for hierarchy sets.
  31. return true;
  32. }
  33. var ctxId = this._getCtxId(selObj);
  34. var bCanDrillDown = true;
  35. /**
  36. *Use drillabiliy in metadata to safe guard the parent of nested single dimension
  37. */
  38. if( oSectionController.getDrillUpDownEnabled() === true){
  39. bCanDrillDown = oSectionController.canDrillDown(ctxId);
  40. }
  41. return (bCanDrillDown && this._getCanExpand( selObj ) && !this._isExpanded(selObj) );
  42. };