0

Have any one tried jQuery-contextMenu with Bootstrap icons?

Sample JS code:

$(function(){
    $.contextMenu({
        selector: '.context-menu-one', 
        items: {
            "edit": {name: "Edit", icon: "glyphicon glyphicon-edit"},
            "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: "quit"}
        }
    });
});

is there any other way to create multilevel contextMenu in bootstrap??

i alarmed alien
  • 9,412
  • 3
  • 27
  • 40
Ganesh
  • 505
  • 2
  • 9
  • 26

2 Answers2

3

You can change the css in the jquery.contextMenu.css for the icon as specified in Use Font Awesome Icons in CSS

Here is an example

Original

.context-menu-item.icon-edit {
  background-image: url(images/edit.png);
}

New

.context-menu-item.icon-edit {
    position: relative;
}
.context-menu-item.icon-edit:before {
    content:"\270f";
    font-family: "Glyphicons Halflings";
    left: 5px;
    position: absolute;
    top: 5;
}
Community
  • 1
  • 1
vbranden
  • 5,814
  • 2
  • 22
  • 15
2

Have a look at this link. This contextmenu is of type bootstrap so you will not get any problem while using it.Hope this Helps

Innodel
  • 1,416
  • 12
  • 16
  • Yah i have already tried this, but it doesn't support multilevel/submenus... :( – Ganesh Oct 18 '14 at 06:45
  • 1
    Than i can say that you have not done enough Reasearch on this. Have a look at [this](http://demo.code-abc.com/tcm/example/) sample, sub menu is working like charm – Innodel Oct 18 '14 at 06:49
  • if i am not wrong both JS used on http://github.com/sydcanem/bootstrap-contextmenu here and in http://demo.code-abc.com/tcm/example sample provided by you are different. – Ganesh Oct 18 '14 at 08:34