Start by storing the ID in such a way that you can retrieve it:
var trow = $('<tr/>').data("id", val.Id);
trow.append('<td>' + val.Id + " " + '</td>');
trow.append('<td>' + val.Title + " " + '</td>');
trow.append('<td>' + val.Description + " " +'</td>');
trow.append('<td>' + val.Location + " " +'</td>');
trow.append('<td>' + '<a href="#" rel="event-details">show</a>' +" "+'</td>');
trow.append('<td>' + "edit" +" " + '</td>');
trow.append('<td>' + "delete" + " " +'</td>');
tab.append(trow);
Then attach the event handler through code, and retrieve the ID from the row:
tab.on("click", "a[rel='event-details']", function(e){
var tr = $(this).closest("tr");
var id = tr.data("id");
$.ajax({ ... });
});