Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ext.define('Core.app.Action', {
- extend: 'Ext.Action',
- initialConfig: {
- iconCls: 'icon-add',
- currentData: undefined,
- actionId: 'D',
- text: "Action D",
- itemId: 'fafasf1',
- handler: function (widget, event) {
- console.log(this.currentData)
- },
- getActionId: function () {
- return this.actionId
- },
- setCurrentData: function (data) {
- this.currentData = data
- this.disable()
- if (data.data.actions) {
- this.currentData.data.actions.forEach(action => {
- if (action === this.actionId) this.enable()
- })
- }
- }
- },
- constructor: function (config) {
- for(let propt in config) {
- if (config.hasOwnProperty(propt)) {
- this.initialConfig[propt] = config[propt]
- }
- }
- config = this.initialConfig
- this.itemId = config.itemId = (config.itemId || config.id || Ext.id());
- this.items = [];
- this.callParent([config]);
- },
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement