Toolbar.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Ext.define('erp.view.common.main.Toolbar',{
  2. extend: 'Ext.Toolbar',
  3. alias: 'widget.erpTreeToolbar',
  4. items: [{
  5. width:215,
  6. xtype: 'searchfield',
  7. id: 'searchField'
  8. }, '->',{
  9. iconCls: 'tree-back',
  10. cls: 'x-btn-tb',
  11. width: 16,
  12. tooltip: $I18N.common.main.treeBack,
  13. hidden: false,
  14. handler: function(){
  15. Ext.getCmp('tree-panel').getTreeRootNode(0);
  16. Ext.getCmp('searchField').setValue(null);
  17. }
  18. },'->'/*, '-',{//将用户每次搜索的字条存入cookie,下次搜索时,作为关键字,可以被用户直接选择;也可以自定义关键字
  19. xtype: 'button',
  20. iconCls: 'x-button-icon-help',
  21. cls: 'x-btn-tb',
  22. width: 16,
  23. tooltip: $I18N.common.main.keywords
  24. }*//*,{
  25. type: 'plus',
  26. id:'open',
  27. cls: 'tree-open',
  28. tooltip:'全部展开',
  29. hidden:false,
  30. handler: function(){
  31. Ext.getCmp('tree-panel').openCloseFun();
  32. }
  33. },{
  34. type:'minus',
  35. id:'close',
  36. tooltip:'全部关闭',
  37. cls: 'tree-close',
  38. hidden:true,
  39. handler: function(){
  40. Ext.getCmp('tree-panel').openCloseFun();
  41. }
  42. },{
  43. type:'refresh',
  44. tooltip:'刷新',
  45. cls: 'tree-refresh',
  46. handler: function(c, t) {
  47. var tree = Ext.getCmp('tree-panel');
  48. tree.setLoading(true, tree.body);
  49. var root = tree.getRootNode();
  50. root.collapseChildren(true, false);
  51. Ext.Function.defer(function() {
  52. tree.setLoading(false);
  53. root.expand(true, true);
  54. Ext.getCmp("open").hide();
  55. Ext.getCmp("close").show();
  56. }, 1000);
  57. }
  58. }*/],
  59. initComponent : function(){
  60. this.callParent(arguments);
  61. }
  62. });