Advertisement
Guest User

sdaada

a guest
Mar 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. Ext.define('Core.app.Action', {
  2. extend: 'Ext.Action',
  3.  
  4. initialConfig: {
  5. iconCls: 'icon-add',
  6. currentData: undefined,
  7. actionId: 'D',
  8. text: "Action D",
  9. itemId: 'fafasf1',
  10.  
  11. handler: function (widget, event) {
  12. console.log(this.currentData)
  13. },
  14.  
  15. getActionId: function () {
  16. return this.actionId
  17. },
  18.  
  19. setCurrentData: function (data) {
  20. this.currentData = data
  21. this.disable()
  22. if (data.data.actions) {
  23. this.currentData.data.actions.forEach(action => {
  24. if (action === this.actionId) this.enable()
  25. })
  26. }
  27. }
  28. },
  29.  
  30. constructor: function (config) {
  31. for(let propt in config) {
  32. if (config.hasOwnProperty(propt)) {
  33. this.initialConfig[propt] = config[propt]
  34. }
  35. }
  36.  
  37. config = this.initialConfig
  38. this.itemId = config.itemId = (config.itemId || config.id || Ext.id());
  39. this.items = [];
  40. this.callParent([config]);
  41. },
  42.  
  43.  
  44.  
  45. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement