calendar_init.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright Scand LLC http://www.scbr.com To use this component please contact
  3. * info@scbr.com to obtain license
  4. *
  5. */
  6. YAHOO.widget.Calendar.prototype._arender = YAHOO.widget.Calendar.prototype.render;
  7. YAHOO.widget.Calendar.prototype.render = function(x, y, obj, val) {
  8. if (obj) {
  9. this.onSelect = function() {
  10. if (!obj._skip_detach)
  11. obj.grid.editStop();
  12. else
  13. obj._skip_detach = false;
  14. }
  15. }
  16. if (val) {
  17. var z = val.split("/");
  18. this.setYear(z[2]);
  19. this.setMonth(z[0] - 1);
  20. obj._skip_detach = true;
  21. this.select((z[0]) + "/" + z[1] + "/" + z[2]);
  22. }
  23. this._arender();
  24. if (x) {
  25. this._myCont.style.display = "";
  26. this._myCont.style.position = "absolute";
  27. this._myCont.zIndex = "19";
  28. this._myCont.style.top = y + "px";
  29. this._myCont.style.left = x + "px";
  30. }
  31. }
  32. YAHOO.widget.Calendar.prototype.hide = function() {
  33. this._myCont.style.display = "none";
  34. }
  35. function _grid_calendar_init() {
  36. var z = document.createElement("DIV");
  37. z.style.display = "none";
  38. z.id = "_cal_" + ((allGetServerTime()).valueOf());
  39. document.body.appendChild(z);
  40. window._grid_calendar = new YAHOO.widget.Calendar("_grid_calendar", z.id);
  41. window._grid_calendar._myCont = z;
  42. window._grid_calendar.render();
  43. window._grid_calendar.hide();
  44. }