jQuery-contextMenu icon indicating copy to clipboard operation
jQuery-contextMenu copied to clipboard

Documentation not clear

Open sathyaprakash94 opened this issue 7 years ago • 9 comments

Pls make clear documentation for the call backs. Its hard to make working the functionality with callback without proper documentation.

sathyaprakash94 avatar Jun 08 '17 11:06 sathyaprakash94

Your right documentation is not clear it also took a hard time to play with the plugin. I hope the author with update its documentation for the beginners to understand easily. I will wait. This plugin is really awesome.

larigyn avatar Jun 09 '17 01:06 larigyn

Yes, its awesome plugin. I used this plugin for my web application. There is some issue I already posted in the community. It will helpful, if the documentation is clear. Many good plugins failed due to incomplete or proper documentation.

sathyaprakash94 avatar Jun 09 '17 12:06 sathyaprakash94

Thanks for the feedback. You mention the callback documentation as one of the places you'd like some improvement. What would help you the most? Some more examples? Combined with an easier overview of some of the core functions so you can jump to the proper examples/documentation?

Good documentation is hard :) If you have suggestions, please put them here.

bbrala avatar Jun 12 '17 06:06 bbrala

Note; icons is another place that needs improvement: See issue #535

bbrala avatar Jun 12 '17 06:06 bbrala

Sir,

For me as a beginner, I would suggest some more examples. To easily understand the implementations. Like in the callback operations. Few things that are commons are callback in modals, callback in routes/jumping into pages. Some beginners like me don't like to read long documentations but rather love to read examples with few explanations. That's it.

larigyn avatar Jun 13 '17 02:06 larigyn

Thanks for your reply. I tried to implement your context menu for a table cell. All are working fine. I can right click and the context menu appears perfectly. But the context menu item fails to open a bootstrap modal, when I'm trying to click on the item.

I know, something I missed to implement, but i don't know where it is. I searched in your examples, is there anything implemented with bootstrap modal. But there is no example found in the page like that.

I hope you understand, what I'm coming to say. Sorry for my bad English, I'm not native English speaker. contextmenu_modal

sathyaprakash94 avatar Jun 14 '17 06:06 sathyaprakash94

Sir,

It's working in my part when I used to call a modal from bootstrap. Im also trying to implement same as your project. But my problem is this picture below.

contextmenu

larigyn avatar Jun 14 '17 13:06 larigyn

The biggest problem I have with callback is that it doesn't describe how to interact with the object you right-clicked on the bring up the menu in the first place. For example:

$(function(){ $.contextMenu({ selector: '.context-menu-one', callback: function(itemKey, opt, rootMenu, originalEvent) { var m = "global: " + key; window.console && console.log(m) || alert(m); }, items: { "edit": { name: "Edit", icon: "edit", // superseeds "global" callback callback: function(itemKey, opt, rootMenu, originalEvent) { var m = "edit was clicked"; window.console && console.log(m) || alert(m); } }, "cut": {name: "Cut", icon: "cut"}, "copy": {name: "Copy", icon: "copy"}, "paste": {name: "Paste", icon: "paste"}, "delete": {name: "Delete", icon: "delete"}, "sep1": "---------", "quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }} } }); });

This is the most common code I've seen regarding callbacks. However, the function only uses itemKey (and elsewhere, options.$trigger.attr). I can't find anything that describes how you use rootMenu or originalEvent. With your data-x variables, I can get to data on my end if it's on the Unordered List. But on the Lists within, where the sub-menu is right-clicked to open the context menu, I can't find how you get something as simple as the text on the object you right-clicked.

So, if I were documenting it, I would add some examples where Add / Edit / Delete, etc and Callbacks actually do something beyond opening a popup box with the name "Add" "Edit" "Delete". Or at least it would say "Add @text", where @text is the text of the item you are going to add.

  • John C

JohnCannonIT avatar May 22 '18 17:05 JohnCannonIT

Thanks for the suggestions on what you miss in the docs, i will take this in consideration when the next version is released.

bbrala avatar May 25 '18 18:05 bbrala