i18n.js 927 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * 打开/切换到新页签
  3. * @param xtype: view xtype
  4. * @param title: 标题
  5. * @param id: id
  6. * @param config: 绑定到view的其他配置
  7. */
  8. function openTab(xtype, title, id, config) {
  9. var mainTab = Ext.getCmp('main-tab-panel');
  10. var panel = Ext.getCmp(id);
  11. if(!panel) {
  12. panel = Ext.create('saas.view.core.tab.Panel', {
  13. id: id,
  14. title: title,
  15. viewType: xtype,
  16. viewConfig: config
  17. });
  18. Ext.suspendLayouts();
  19. mainTab.setActiveTab(mainTab.add(panel));
  20. Ext.resumeLayouts(true);
  21. }else {
  22. mainTab.setActiveTab(panel);
  23. }
  24. }
  25. /**
  26. * 显示toast提示
  27. * @param content: 内容
  28. * @param title: 标题
  29. *
  30. */
  31. function showToast(content, title) {
  32. Ext.toast({
  33. html: content,
  34. title: title,
  35. closable: false,
  36. align: 't',
  37. slideDUration: 400,
  38. maxWidth: 400
  39. });
  40. }