Form.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. Ext.define('erp.view.ma.copy.Form', {
  2. extend:'Ext.form.Panel',
  3. alias:'widget.erpCopyFormPanel',
  4. id:'form',
  5. title: '单据复制设置',
  6. region:'north',
  7. frame:true,
  8. layout: 'column',
  9. autoScroll:true,
  10. defaultType: 'textfield',
  11. labeSeparator:':',//默认:
  12. buttonAlign:'center',
  13. cls:'u-form-default',
  14. formCondition:'',
  15. FormUtil: Ext.create('erp.util.FormUtil'),
  16. fieldDefaults:{
  17. fieldStyle:'background:#FFFAFA;color:#515151;',
  18. focusCls:'x-form-field-cir-focus',
  19. labelAlign:'right',
  20. msgTarget:'side',
  21. blankText:$I18N.common.form.blankText
  22. },
  23. initComponent : function(){
  24. var me = this;
  25. formCondition = getUrlParam('formCondition');//从url解析参数
  26. formCondition = (formCondition == null) ? "" : formCondition.replace(/cc_callerIS/g,"");
  27. me.formCondition = formCondition;
  28. this.addKeyBoardEvents();
  29. this.callParent(arguments);
  30. },
  31. items: [{
  32. fieldLabel:'<font color="red">单据Caller</font>',
  33. name: 'cc_caller',
  34. id:'cc_caller',
  35. xtype:'textfield',
  36. readOnly:true,
  37. editable:false,
  38. allowBlank:true,
  39. maxLength:200,
  40. maxLengthText:'字段长度不能超过200字符',
  41. columnWidth:0.33,
  42. cls:'form-field-allowBlank',
  43. fieldStyle:'background:#e0e0e0;color:#515151;',
  44. allowBlank: true,
  45. labelAlign : 'right',
  46. labelWidth:80,
  47. /*margin: '0 0 0 0'*/
  48. }],
  49. listeners: {
  50. 'afterrender': function() {
  51. Ext.getCmp('cc_caller').setValue(formCondition);
  52. }
  53. },
  54. dockedItems:[{
  55. xtype:'toolbar',
  56. dock:'bottom',
  57. defaults:{
  58. styple:{
  59. marginLeft:'10px'
  60. }
  61. },
  62. items:["->",
  63. {
  64. xtype:'erpUpdateButton',
  65. height:26
  66. },{
  67. xtype:'erpCloseButton',
  68. height:26
  69. },"->"]
  70. }],
  71. addKeyBoardEvents: function(){
  72. var me = this;
  73. Ext.EventManager.addListener(document.body, 'keydown', function(e){
  74. if(e.altKey && e.ctrlKey) {
  75. if(e.keyCode == Ext.EventObject.S) {
  76. var url = "jsps/ma/detailgrid.jsp?gridCondition=dg_callerIS"+caller;
  77. me.FormUtil.onAdd('gird' + caller, 'DetailGrid配置维护(' + caller + ')', url);
  78. }
  79. }
  80. });
  81. }
  82. });