RenderCallback.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Content Explorer
  5. *| (C) Copyright IBM Corp. 2015, 2018
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or disclosure
  8. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *+------------------------------------------------------------------------+
  10. */
  11. define([
  12. 'bacontentnav/lib/@waca/core-client/js/core-client/ui/properties/BaseProperty',
  13. 'underscore'
  14. ], function(BaseProperty, _) {
  15. 'use strict';
  16. /**
  17. For custom UI in the middle of a propertyUIControl you can use this class. It'll call your renderCallback function
  18. at the appropriate time with the container node so you can render your own UI
  19. **/
  20. /**
  21. This is a TEMP class until we can refactor the member picker and permissions tab so that the list control can be broken out into a seperate view
  22. **/
  23. var RenderCallback = BaseProperty.extend({
  24. ellipses: true,
  25. handleReturnKey: true,
  26. /**
  27. @param options.el {node} - container DOM node
  28. @param options.renderCallback {function} - function to render custom UI. Should return a Q promise
  29. **/
  30. init: function(options) {
  31. RenderCallback.inherited('init', this, arguments);
  32. _.extend(this, options);
  33. },
  34. doRender: function() {
  35. return this.renderCallback(this.el);
  36. }
  37. });
  38. return RenderCallback;
  39. });