TaskContextMenu.js 888 B

123456789101112131415161718192021222324252627282930
  1. //extended context menu, color picker added
  2. Ext.define('MyApp.TaskContextMenu', {
  3. extend: 'Gnt.plugin.TaskContextMenu',
  4. constructor : function(){
  5. this.texts.changeColor = 'Change task color';
  6. this.callParent(arguments);
  7. },
  8. createMenuItems : function() {
  9. var items = this.callParent(arguments);
  10. return [{
  11. text: this.texts.changeColor,
  12. menu: {
  13. showSeparator: false,
  14. items: [
  15. Ext.create('Ext.ColorPalette', {
  16. listeners: {
  17. select: function(cp, color){
  18. this.rec.set('TaskColor', color);
  19. },
  20. scope: this
  21. }
  22. })
  23. ]
  24. }
  25. }].concat(items);
  26. }
  27. });