I would like to pass the value of the variable orderSlipID to this createLink.
function showOrderedItems() {
$.ajax({
url: '${createLink(action:'listOrderedMenu', id:orderSlipID)}',
success: function(data) {
$('#orderedlist').html(data);
}
});
};
this orderSlipID comes from a seperate GSP. I would like to set the id of the createLink to the id of the button that I click.
Here's my other GSP:
<g:each in="${orderSlipInstanceList}" var="os">
<div class="table" data-slip="${os.id}">${os.tableNumber}</div>
</g:each>
<script>
$('.table').click(function(){
orderSlipID = parseInt($(this).attr('data-slip'));
showOrderedItems();
});
</script>
So when I click a table it will save the id of the orderedSlip to orderSlipID and pass it to createLink to display the new content of #orderedlist.
datain the Ajax request.