This repository was archived by the owner on Aug 14, 2021. It is now read-only.

Description
The setEntry functionality can be used with a string or an object input.
$("#details").contextmenu("setEntry", "opt1", {title: titleText});
$("#details").contextmenu("setEntry", "opt2", titleText);
This is the first right click. Things seem to be working as expected.

The second right click shows that there is something wrong. The title modification from the first right click is present in option 1.

Here is a working example:
<link href="js/lib/jquery-ui-1.10.3/css/smoothness/jquery-ui-1.10.3.custom.css" type="text/css" rel="stylesheet" />
<script src="js/lib/jquery-1.8.2.min.js" type="text/javascript"></script>
<script src="js/lib/jquery-ui-1.10.3/js/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>
<script src="js/lib/jquery.ui-contextmenu.js" type="text/javascript"></script>
<style type="text/css">
.hasmenu {
border: 1px solid #008;
margin: 3px;
padding: 5px;
width: 30px;
}
.ui-widget{
font-size: .8em;
}
table, td {
border: 1px solid dimgray;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
function action (event, ui) {
console.log(ui.target);
};
$("#details").contextmenu({
delegate: ".hasmenu",
menu: [
{title: "Option 1 title", cmd: 'opt1', action: action},
{title: "Option 2 title", cmd: 'opt2', action: action}
],
beforeOpen: function(event, ui) {
var titleText = 'record ' + ui.target.parent().attr('record');
$("#details").contextmenu("setEntry", "opt1", {title: titleText});
$("#details").contextmenu("setEntry", "opt2", titleText);
}
});
});
</script>
<table id="details" class="table">
<thead>
<tr>
<th>Id</th>
<th>File Name</th>
<tr />
</thead>
<tbody>
<tr record="1" class="hasmenu">
<td>1</td>
<td>Record 1</td>
</tr>
<tr record="2" class="hasmenu">
<td>2</td>
<td>Record 2</td>
</tr>
</tbody>
</table>