ExportSMT.js 731 B

12345678910111213141516171819202122232425
  1. Ext.define('erp.view.core.button.ExportSMT',{
  2. extend: 'Ext.Button',
  3. alias: 'widget.erpExportSMTButton',
  4. iconCls: 'x-button-icon-excel',
  5. cls: 'x-btn-gray',
  6. id:'exportSMT',
  7. text: $I18N.common.button.erpExportSMTButton,
  8. style: {
  9. marginLeft: '10px'
  10. },
  11. width: 70,
  12. initComponent : function(){
  13. this.callParent(arguments);
  14. },
  15. handler:function(){
  16. var grid = Ext.getCmp('grid');
  17. var form = Ext.getCmp('form');
  18. console.log(form.title);
  19. var key = Ext.getCmp(form.keyField).value;
  20. if(grid && key > 0) {
  21. window.location = basePath + 'pm/mes/exportSMT.xls?caller=ProductSmt!Import'+
  22. '&title=' + (form.title.replace(/»/g, '/') + '&id=' + key);
  23. }
  24. }
  25. });