NewAnnotationAction.js 939 B

123456789101112131415161718192021222324252627
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2001, 2012
  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. /**
  13. * NewAnnotationAction - implements adding new annotations in cognos viewer
  14. */
  15. function NewAnnotationAction() {}
  16. NewAnnotationAction.prototype = new AnnotationAction();
  17. NewAnnotationAction.prototype.executeAction = function(viewer, widget, selection)
  18. {
  19. if (viewer && widget && selection) {
  20. var cellRef = selection.getCellRef();
  21. var ctxId = viewer.findCtx(cellRef);
  22. var value = selection.getDisplayValues()[0];
  23. window.setTimeout(function () { widget.getAnnotationHelper().addComment(ctxId, value); },0);
  24. }
  25. };