Find the grid on which the context menu item is clicked on - extjs6

I have a grid panel and i have a item context menu on it, which have sub items as well. When a user clicks on the sub menu item or context menu item, i want to know on which grid panel this context menu is on. Can i do this?

Use the add method to add the menu to the corresponding grid, and then later, you can get the grid using the up method.

Related

mediaelement.js context menu

Could anyone point me to the code snippet where I can find the usage of context menu for mediaelement.js?
I am looking to disable the context menu that pops up when I do right click on the video and also to add/delete context menu elements.
You can edit the items which are displayed in the context menu by editing the method renderContextMenu in the file mediaelementplayer.js
Setting as follows will prevent any menu items from appearing:
var t = this,
html = '',
items=''; --> no menu items

Delphi TMenuItem OnClick not working if menu has sub items

It appears Onclick events are not processed for menu items that have sub-items.
I realize I could create a leaf item which users could use instead, but I would like to have my menu folders respond to OnClick (in my case to "launch" all sub-items)
Is there any way around this limitation?
Menu items that have sub-items do indeed fire OnClick events. But they fire when the sub-menu opens rather than when you click on the parent menu item.
I'm pretty sure you don't want to invoke all sub-items when that happens. The OnClick event for a parent menu fires whenever the sub-menu is opened. Either when you click on the parent menu item, hover over it, or press the right arrow key when the menu item is selected via the keyboard.
So, the OnClick event for a parent menu corresponds to opening the sub-menu. Invoking all the child menu item actions when the sub-menu is opened goes against all standard expected UI behaviour. What you should do is add another sub-item that can be used to invoke all actions. Don't go against the platform standard UI unless there are no sane alternatives.

Cannot detect Frontpage properly in Joomla 2.5 templates

I've seen in Joomla documentation the way to detect if you are in Frontpage while creating a template in Joomla 2.5. This is the code:
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault()) {
echo 'This is the front page';
}
?>
This works when you are at home page (or clicking on Home menu), but I have an slider in home page, and I link in the slider to an article which is not in any menu item in the application. When I load this article the code above returns as I were at frontpage. I guess that if I doesn't click on any menu item, $menu->getActive() doesn't change.
Any suggestion?
Thanks in advance.
You can do one thing to solve this problem. Create a hidden menu of all the article links which are linked in the sliders.By creating hidden menu the link will be initialized and $menu->getActive() will work for all the links..Hopefully it will works for you .
I wish to add to the present answer and provide some clarifications.
In order for the menu selection to be detected the page requires to be assigned to a menu item. If this is a hidden menu than the link to such a page called My Page would be:
/index.php/my-page - “my-page” is the menu title alias for this item
However, if one wants to show the correct hierarchy in the breadcrumbs for the same page, then the menu hierarchy would have to be replicated in the hidden menu.
For example if My Page is under My Articles main menu item, then in the hidden menu you should add “My Articles” item, of the type: Menu Item Alias, which is in the Systems submenu of the menu type field. The My Page item should be a sub-menu item of My Articles.
The “My Articles” menu item in the hidden menu must have a different menu alias than the same one in the main menu hence the new link to My Page would look like:
/index.php/my-articles2/my-page
To create a hidden menu, one simply creates another menu. It does not matter whether one creates a module for it or not, but if one does then one just should not assign any position to that module.

Tab Context Menu for WeifenLuo.WinFormsUI.Docking

I'm using the "WeifenLuo.WinFormsUI.Docking" control.
I need to show a context menu by clicking on a document tab.
At the moment I just can show a context menu at the document itself or for the menustrip - but I didn't found a way to bind a menu to the tab.
Does anyone have an idea?
There exists a property called TapPageContextMenu.
To bind a context menu to tab register on top use:
DockContent.TabPageContextMenu
Is this what you were looking for?

Delphi 2010 Action Manager & Main Menu Bar

I'm trying to use the Action Manager and Action Main Menu Bar in Delphi 2010 an I have no idea how to make this work. I've tried looking at the examples that come with Delphi 2010 and I can't seem to figure this out.
I've tried playing around with the examples. I've been able to add an image to the Image List component and set that item to the new item index. At design time it displays properly at runtime it reverts back to the original.
I'd like to learn how to use the Action Manager and Action Main Menu Bar but I can find any help on these topics. Is there a tutorial on how to use the Action Manager and Action Main Menu Bar?
Drag and drop a ActionManager, a ActionMainMenuBar and a ImageList on your form.
Doubleclick the ImageList, you get the Imagelist Editor. Use the Add-button to add your icons (make sure their sizes are the same as the Height and Width properties that are set in the ImageList-control).
Set the Images-property of the ActionManager to your ImageList and set the ActionManager-property of your ActionMainMenuBar to your ActionManager.
Doubleclick the ActionManager, go to the tab 'Actions' and add new actions by the 'New'-button.
Click each Action in the ActionManager and set each action's properties, at least: ImageIndex (to choose an Icon), Caption and Category.
Note: A Category will serve as a main item in the menu (like File, Edit and View) and each Action will serve as menu item (like Save, Save as, Load). So set the Category property of all actions you want to belong to one main menu item to the same name. For instance give the actions 'Save' and 'Load' the category 'File' and give the actions 'Undo' and 'Redo' the category 'Edit'.
Doubleclick each Action in the ActionManager. You'll get the code editor. Type the code you want to perform when the user clicks this menu item. If you don't type any code or comment, the menu item will automatically be disabled when the application is running.
Now drag the categories from the ActionManager to the ActionMainMenuBar.
That's it.
I think Actions, Action Lists And Action Managers by Brian Long is a great start to explore the realm of actions.

Resources