contextmenu

jQuery fullcalendar: contextmenu

a 夏天 提交于 2019-12-04 08:44:45
问题 I want to use jQuery.contextMenu: http://abeautifulsite.net/blog/2008/09/jquery-context-menu-plugin In jQuery.fullcalendar when I right-click on an event how does it work? 回答1: i don't know the contextmenu plugin but i think you can bind it on the eventRender event of fullcalendar. I have the problem with dblClick on an event. This is a part of my solution: eventRender: function(event, element) { element.bind('dblclick', function() { dopbClickFunction(event,element); ....... 回答2: I'm solving

jQuery allow contextmenu only on certain elements

允我心安 提交于 2019-12-04 07:46:26
// this works $(document).on('contextmenu', function() { return false; }); // without the code above, this works too $(document).on('contextmenu', '#special', function() { alert('#special right clicked'); }); How can I combine these 2 pieces of code so that I can disable context menu on the whole document except the one with id #special. $(document).on('contextmenu', function(e) { if (!$(e.target).is("#special")) return false; alert('#special right clicked'); // you may want e.preventDefault() here }); Using the .is() method lets you test whether the clicked element matches any selector, which

Custom context menu in d3 and svg

痴心易碎 提交于 2019-12-04 07:22:58
I would like to have custom context menu appearing when I right click on an svg circle. For now I have found this answer that helps me to handle the right click with the following code: .on("contextmenu", function(data, index) { //handle right click //stop showing browser menu d3.event.preventDefault() }); Now I would like to know how I can show a box containing some HTML. Thanks in advance. d3.select('#stock_details .sym').on("contextmenu", function(data, index) { var position = d3.mouse(this); d3.select('#my_custom_menu') .style('position', 'absolute') .style('left', position[0] + "px")

ContextMenu for ListViewItem only

霸气de小男生 提交于 2019-12-04 06:11:34
I have a context menu - problem is I need it to only open when a listviewitem is clicked. Right now it will open if I click anywhere in the listview or in the header. <ListView> <ListView.ContextMenu> <ContextMenu> <MenuItem Header="More Info" Command="{Binding MoreInfo}" /> </ContextMenu> </ListView.ContextMenu> <ListView.View> <GridView> <!-- columns and stuff here --> </GridView> </ListView.View> </ListView> I have tried adding the ContextMenu as a resource and applying it as a style, but this breaks the command (clicking on More Info should open a dialog window, doesnt work this way)

onCreateContextMenu isn't being called

丶灬走出姿态 提交于 2019-12-04 05:53:29
It looks like the onCreateContextMenu insn't being called at all. In my onCreate for my ListActivity I have: list = getListView(); registerForContextMenu(list); (I know it's redundant, and I've just passed getListView() with the same results). Here is my onCreateOntextMenu; @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); Log.d("LM", "onCreateContextMenu"); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.context_landmarks, menu); } The log never gets generated. Doesn't anyone have

Bind ContextMenu's MenuItem visibility to ListView selection

99封情书 提交于 2019-12-04 05:37:43
I have a user control with a ListView containing simple items from an ObservableCollection. I would like the ContextMenu of that ListView to contain items depending on what's selected in the ListView. If no item is selected, some MenuItems should not be visible. My converter isn't even called when I open the ContextMenu. The binding seems to be wrong, I find this in the output window: System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=listView'. BindingExpression:Path=SelectedItem; DataItem=null; target element is 'MenuItem' (Name=''); target property is

DataGridColumnHeader ContextMenu programmatically

China☆狼群 提交于 2019-12-04 05:12:21
I have this code in View.cs var contextMenu = this.dataGridFacade.GiveContextMenuForDataGrid(this.DataGridAllJobs); this.DataGridAllJobs.ContextMenu = contextMenu; But I want to add this context menu for header only. Is it possible? You just have to retrieve the DataGridColumnHeadersPresenter of your DataGrid and set its ContextMenu. var contextMenu = this.dataGridFacade.GiveContextMenuForDataGrid(this.DataGridAllJobs); var columnHeadersPresenter = this.DataGridAllJobs.SafeFindDescendant<DataGridColumnHeadersPresenter>(ip => ip.Name == "PART_ColumnHeadersPresenter"); if (columnHeadersPresenter

Show ContextMenu on Left Click using only XAML

自作多情 提交于 2019-12-04 04:29:07
The default behavior of a WPF ContextMenu is to display it when the user right-clicks. I want the ContextMenu to show when the user left-clicks. It seems like this should be a simple property on ContextMenu , but it is not. I rigged it, so that I handle the LeftMouseButtonDown event in the code-behind and then display the context menu. I'm using MVVM in my project which means I'm using DataTemplate s for the items that have the context menus. It would be much more elegant to get rid of the code-behind and find a way to display the context menu using triggers or properties in the XAML. Any

Using MVVM, how can a ContextMenu ViewModel find the ViewModel that opened the ContextMenu?

北城余情 提交于 2019-12-04 03:56:29
I'm using MVVM to bind views to objects in a Tree. I have a base class that implements the items in my tree, and that base class has a ContextMenu property: public IEnumerable<IMenuItem> ContextMenu { get { return m_ContextMenu; } protected set { if (m_ContextMenu != value) { m_ContextMenu = value; NotifyPropertyChanged(m_ContextMenuArgs); } } } private IEnumerable<IMenuItem> m_ContextMenu = null; static readonly PropertyChangedEventArgs m_ContextMenuArgs = NotifyPropertyChangedHelper.CreateArgs<AbstractSolutionItem>(o => o.ContextMenu); The View that binds to the base class (and all derived

Retain DataGrid IsSelectionActive when a ContextMenu opens in WPF?

孤街浪徒 提交于 2019-12-04 02:45:50
I have a DataGrid which has a style for IsSelectionActive ; however, as soon as the ContextMenu opens, the grid loses IsSelectionActive and it looks like to the user that as if the context menu somehow took the selection and may confuse the user. Is there a way to retain IsSelectionActive when a context menu opens? <ControlTemplate.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <!--<Condition Property="Selector.IsFocused" Value="True" />--> <Condition Property="IsSelected" Value="True" /> </MultiTrigger.Conditions> <Setter Property="Background" Value="Red" /> </MultiTrigger> <MultiTrigger>