Guest User

Untitled

a guest
Feb 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. Ajax.PradoCallback = Class.create({
  2. initialize: function(element, eventName, value, options) {
  3. options = options || { };
  4. if (options.HasPriority == null)
  5. options.HasPriority = false;
  6.  
  7. this.transport = new Prado.CallbackRequest('ctl0$ContMain$Ajax', options);
  8. this.transport.setCallbackParameter({
  9. Value: value || '',
  10. EventName: eventName,
  11. ClientID: $(element).identify().camelize()
  12. });
  13. this.transport.dispatch();
  14. }
  15. });
  16.  
  17. Element.addMethods({
  18. callback: function(element, eventName, value, options) {
  19. new Ajax.PradoCallback(element, eventName, value, options);
  20. return $(element);
  21. },
  22.  
  23. updateByCallback: function(element, eventName, value, options) {
  24. options = Object.clone(options);
  25. var onComplete = options.onComplete;
  26. options.onComplete = function(request) {
  27. element.update(request.transport.responseText);
  28. if (Object.isFunction(onComplete)) onComplete(request);
  29. };
  30. return $(element).callback(eventName, value, options);
  31. }
  32. });
Add Comment
Please, Sign In to add comment