Issues with the Gnt.plugin.TaskContextMenu documentation
- mseankelly
- Posts: 4
- Joined: Mon Sep 05, 2016 8:22 pm
Issues with the Gnt.plugin.TaskContextMenu documentation
The sample code for customizing the menu had this:
I believe it should be this:
Also, I'm getting the following error:
Here's my code:
Why can't it find 'deleteTask'?
Thanks.
Code: Select all
createMenuItems : function () {
return this.callParent().concat({
text : 'My handler',
handler : this.onMyHandler,
scope : this
});
this.on('beforeshow', this.onMyBeforeShow, this);
},
Code: Select all
createMenuItems : function () {
this.on('beforeshow', this.onMyBeforeShow, this);
return this.callParent().concat({
text : 'My handler',
handler : this.onMyHandler,
scope : this
});
},
Code: Select all
jira-gantt.js:29 Uncaught TypeError: Cannot read property 'setVisible' of null
Code: Select all
Ext.define('JiraGantt.plugin.TaskContextMenu', {
extend : 'Gnt.plugin.TaskContextMenu',
createMenuItems : function () {
console.log("createMenuItems");
this.on('beforeshow', this.onMyBeforeShow, this);
return this.callParent().concat({
text : 'My handler',
handler : this.onMyHandler,
scope : this
});
},
onMyHandler : function () {
// the task on which the right click have occured
var task = this.rec;
console.log("onMyHandler");
// do something with the task on right click...
},
onMyBeforeShow : function() {
// For the moment, don't allow deletes.
// Might do something fancier later, like allow deletes
// for versions and MMFs not containing stories.
console.log("onMyBeforeShow");
this.down('deleteTask').setVisible(false); // ERROR OCCURS HERE!!
}
});
Thanks.
- Maxim Gorkovsky
- Core Developer
- Posts: 3307
- Joined: Wed Jan 08, 2014 11:46 am
Re: Issues with the Gnt.plugin.TaskContextMenu documentation
Hello.
Documentation bug will be soon fixed. And you cannot find button because you use wrong selector, use this instead:
Documentation bug will be soon fixed. And you cannot find button because you use wrong selector, use this instead:
Code: Select all
this.down('#deleteTask')
- mseankelly
- Posts: 4
- Joined: Mon Sep 05, 2016 8:22 pm
Re: Issues with the Gnt.plugin.TaskContextMenu documentation
OK, that fixed it. You should probably add the "#" to the sample code as well.
Thanks.
Thanks.
- mseankelly
- Posts: 4
- Joined: Mon Sep 05, 2016 8:22 pm
Re: Issues with the Gnt.plugin.TaskContextMenu documentation
Alright, now I want to remove "Delete Dependency" from the context menu. I've tried "#deleteDependency" and "#dependencyDelete".
Where in the documentation would I find the list of menu selectors?
Thanks.
Where in the documentation would I find the list of menu selectors?
Thanks.
- Maxim Gorkovsky
- Core Developer
- Posts: 3307
- Joined: Wed Jan 08, 2014 11:46 am
Re: Issues with the Gnt.plugin.TaskContextMenu documentation
We do not document such things, it's implementation details. You may find itemId in code, in this case it's #deleteDependencyMenu. But if you're removing already 2 items, you may consider to take full control over them by overriding this method.
- mseankelly
- Posts: 4
- Joined: Mon Sep 05, 2016 8:22 pm
Re: Issues with the Gnt.plugin.TaskContextMenu documentation
OK, help me out. How would I discover that the string should be "#deleteDependencyMenu" without asking in this forum?
Thanks.
Thanks.
- Maxim Gorkovsky
- Core Developer
- Posts: 3307
- Joined: Wed Jan 08, 2014 11:46 am
Re: Issues with the Gnt.plugin.TaskContextMenu documentation
Easiest way - inspect items in the debugger. You could also read our code and find it.