SchedulerTrigger.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * 会议室资源查看
  3. */
  4. Ext.define('erp.view.core.trigger.SchedulerTrigger', {
  5. extend: 'Ext.form.field.Trigger',
  6. alias: 'widget.SchedulerTrigger',
  7. triggerCls: 'x-form-color-trigger',
  8. onTriggerClick: function() {
  9. var trigger = this,
  10. bool = true; // 放大镜所在
  11. bool = trigger.fireEvent('beforetrigger', trigger);
  12. dbCaller=this.dbCaller|| (typeof caller === 'undefined' ? '' : caller);
  13. if (bool == false) {
  14. return;
  15. }
  16. this.setFieldStyle('background:#C6E2FF;');
  17. var width = Ext.isIE ? screen.width * 0.7 * 0.9 : '80%',
  18. height = Ext.isIE ? screen.height * 0.75 : '95%';
  19. //针对有些特殊窗口显示较小
  20. width =this.winWidth ? this.winWidth:width;
  21. height=this.winHeight ? this.winHeight:height;
  22. var dbwin = new Ext.window.Window({
  23. id: 'dbwin',
  24. title: '查找',
  25. height: height,
  26. width: width,
  27. maximizable: true,
  28. buttonAlign: 'center',
  29. layout: 'anchor',
  30. items: [{
  31. tag: 'iframe',
  32. frame: true,
  33. anchor: '100% 100%',
  34. layout: 'fit',
  35. html: '<iframe id="iframe_dbfind" src="' + basePath + 'jsps/oa/SchedulerResource.jsp?trigger=' + trigger.id + "&caller=" + dbCaller+ '" height="100%" width="100%" frameborder="0" scrolling="no"></iframe>'
  36. }],
  37. buttons: [{
  38. text: '关 闭',
  39. iconCls: 'x-button-icon-close',
  40. cls: 'x-btn-gray',
  41. handler: function() {
  42. Ext.getCmp('dbwin').close();
  43. }
  44. },
  45. {
  46. text: '重置条件',
  47. id: 'reset',
  48. cls: 'x-btn-gray',
  49. hidden: true,
  50. handler: function() {
  51. var grid = Ext.getCmp('dbwin').el.dom.getElementsByTagName('iframe')[0].contentWindow.document.defaultView.Ext.getCmp('dbfindGridPanel');
  52. grid.resetCondition();
  53. grid.getCount();
  54. }
  55. }]
  56. });
  57. dbwin.show();
  58. trigger.lastTriggerId = null;
  59. }
  60. });