Finally got it working. I thank you all for your support, time and
patience.
$(document).ready(function() {
var currentCellText;/*this variable will have the clicked cell value*/
$("tbody td").mousedown(function(e) {
currentCellText = $(this).text();
});
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var m = "clicked: " + currentCellText;
window.console && console.log(m)||
test_call(currentCellText);
},
items: {
"Menu 1": {name: "Menu 1"},
"Menu 2": {name: "Menu 2"},
}
});
});
function test_call(val)
{
$.ajax({
type: 'GET',
url:'/leave',
data:{ foo: val },
success:function(data){
alert(data);
}
});
}
Nikhil
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment