Wijmo 5 [Input]
Context Menu
HTML
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://cdn.wijmo.com/5.20162.198/styles/wijmo.min.css">
<script src="http://cdn.wijmo.com/5.20162.198/controls/wijmo.min.js"></script>
<script src="http://cdn.wijmo.com/5.20162.198/controls/wijmo.input.min.js"></script>
<script src="http://cdn.wijmo.com/5.20162.198/controls/wijmo.input.min.js"></script>
<script src="http://cdn.wijmo.com/5.20162.198/interop/angular/wijmo.angular.min.js"></script>
<div ng-app="app" ng-controller="appCtrl">
<p>
Try opening the context menu on regular cells and on column header cells
to see the difference.
</p>
<section >
<div class="btn btn-default" wj-context-menu="#ctxMenu">Menu</div>
</section>
<div style="height:50px;margin:10px;padding:10px;background-color: blanchedalmond;">Content to write</div>
<wj-menu id="ctxMenu"
ng-hide="true"
items-source="menuCommands"
display-member-path="header"
item-clicked="menuItemClicked(s, e)">
</wj-menu>
<section >
<div class="btn btn-default" wj-context-menu="#ctxMenu">Menu</div>
</section>
</div>
JavaScript
var app = angular.module('app', ['wj']);
// controller
app.controller('appCtrl', function ($scope) {
$scope.menuCommands = [
{ header: 'Custom', context: 3 },
{ header: 'Cut', context: 1 },
{ header: 'Copy', context: 1 },
{ header: 'Paste', context: 1 },
{ header: 'Search', context: 2 },
{ header: 'Replace', context: 2 },
];
// customize the context menu depending on the cell that was clicked
$scope.menuItemClicked = function (s, e) {
var menu = s;
alert('thanks for selecting option ' + menu.selectedItem.header);
}
});