Section.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. Type.registerNamespace("Demo");
  2. // Constructor
  3. Demo.Section = function(element) {
  4. Demo.Section.initializeBase(this, [element]);
  5. }
  6. Demo.Section.prototype = {
  7. // Create add and remove accessors fot the complete event.
  8. add_complete: function(handler) {
  9. this.get_events().addHandler("complete", handler);
  10. },
  11. remove_complete: function(handler) {
  12. this.get_events().removeHandler("complete", handler);
  13. },
  14. // Create a function to raise the complete event.
  15. raiseComplete: function() {
  16. var h = this.get_events().getHandler('complete');
  17. if (h) h(this);
  18. },
  19. // Release resources before control is disposed.
  20. dispose: function() {
  21. var element = this.get_element();
  22. $clearHandlers(element);
  23. Demo.Section.callBaseMethod(this, 'dispose');
  24. }
  25. }
  26. Demo.Section.registerClass('Demo.Section', Sys.UI.Control);
  27. // Since this script is not loaded by System.Web.Handlers.ScriptResourceHandler
  28. // invoke Sys.Application.notifyScriptLoaded to notify ScriptManager
  29. // that this is the end of the script.
  30. if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();