contextmenu

How to trigger contextmenu on left mouse button click?

风格不统一 提交于 2019-12-13 19:22:51
问题 I'm trying to use contextmenu for the left menu button click but it's not working: <input type="button" id="selector" value="click" /> jquery: $('#selector').on('click',function(){ $(this).triggerHandler('contextmenu') }); How should I implement? Please check this is not working fiddle Please note: I want to use default contextmenu on left click. 回答1: If you are using contextmenu plugin then you can simply use trigger: 'left' for left button click. $(function(){ $.contextMenu({ selector: '

Browser Context Menu customization?

我的梦境 提交于 2019-12-13 19:19:14
问题 Is there a way to override the "undo" and "select all" in right click context menu of the browser over textarea? Thank you. 回答1: You cannot edit the browser's built-in context menu, but you can disable it and replace it with your own using the oncontextmenu event on the window object. I would caution that this is often a bad idea. Users expect to find the built-in context menu and are often frustrated when it isn't there. 回答2: I know you can prevent the whole context menu from opening by

MenuItem Passing selected item to ViewModel via RelayCommand ala MVVM-Light & Header

随声附和 提交于 2019-12-13 19:17:16
问题 I've been working off of this Q/A and a bunch of others to try and figure this out, but I must be missing something simple: Bind Items to MenuItem -> use Command I created this little test application to try and understand context menus and learn about how to wire up the click events to relay commands in the ViewModel, and get access to the currently selected item from the context menu. Here is the XAML: <Window x:Class="ContextMenuTest_01.MainWindow" xmlns="http://schemas.microsoft.com/winfx

Context menu for spinner item

試著忘記壹切 提交于 2019-12-13 18:08:53
问题 How would I go about adding a context menu to a spinner popup? I have a spinner that is populated by a database cursor, and I'd like to have a context menu so when the user long clicks an item they can edit or delete the item (two options in context menu). I can't seem to find a way to register a context menu for the window that appears with the selectable items. Is there a way to, like on a list View? Otherwise, what about having a hidden view that is registered for a context menu and then

How to switch to new Activity from menu?

笑着哭i 提交于 2019-12-13 14:13:31
问题 I have a menu and would like to open a new Activity when the user clicks on the menu item: @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle item selection switch (item.getItemId()) { case R.id.add_symbol: System.out.println("ADD SYMBOL CLICKED!"); Intent myIntent = new Intent(this.getContext(), AddStocksActivity.class); startActivityForResult(myIntent, 0); return true; default: return super.onOptionsItemSelected(item); } } I'm not sure how to create my Intent properly

How to set specific context menu depending on which item is long-pressed in a ListActivity?

家住魔仙堡 提交于 2019-12-13 13:11:33
问题 I have a list activity, and I chose to manually add the first item which is "add new item...". I have registered the context menu for the whole listview, using registerForContextMenu(getListView()); straight into the onCreate . When the context menu is build, the system calls onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) . The View v is the listView, and I cannot find a way to know which item in the listview is being long-pressed. I could create a xml layout, with a

Enabling jQuery contextMenu item on ajax request

倖福魔咒の 提交于 2019-12-13 12:09:45
问题 I'm trying to update contextmenu item if ajax requests alters my div content. Here is what I mean I have a div like this : <div id="" class="message" data-options='{"update":"YES", "delete":"NO"> </div> And context Menu jquery part (this happens only once when body loads): $.contextMenu({ selector: '.message', trigger: 'left', callback: function(key, options) { var m = "clicked: " + key; window.console && console.log(m) || alert(m); }, items: { "update": { name: "Update", disabled: function

How to Edit contact from context Menu

試著忘記壹切 提交于 2019-12-13 07:33:40
问题 I have been developing a contact app, it allows : call, sms, delele, etc ... and Edit Contact. When user click and hold on a contact, a context menu show (picture below). The actions call, sms, ... was completed but Edit is n't. Please give me some code or advice . Thanks in advance Image is here. @Override public boolean onContextItemSelected(MenuItem item) { AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); switch (item.getItemId()) { case R.id.call: //do something

Removing the default Context Menu when Editing a cell in DataGridView

北城以北 提交于 2019-12-13 07:24:06
问题 In my DataGridView, when I am editing a textbox cell, and I right click I get the following default Context Menu: How can I disable this "feature" and instead have my own context Menu popup? 回答1: Is this is what you asking about? You can find the similar question using this link. private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { e.Control.ContextMenuStrip = myContextMenuStrip; } 来源: https://stackoverflow.com/questions/16309613

Column-specific context menu for Primefaces DataTable

被刻印的时光 ゝ 提交于 2019-12-13 06:19:39
问题 How can I define context menu for each column differently in Primefaces datatable? Putting <p:contextMenu> inside <p:column> does not work properly. I want context menu to be different depending on which column user right-clicked in. This does not work (context menu is created the same for all columns): <p:dataTable value="#{values}" var="value" selectionMode="single" selection="#{selectedValue}" id="table"> <p:column headerText="Col 1"> <h:outputText value="#{value.balance}"> <f