Lots of changes.

This commit is contained in:
James Cole
2015-03-04 09:42:47 +01:00
parent 92af4e5c96
commit f5437a17f8
18 changed files with 316 additions and 162 deletions

View File

@@ -42,20 +42,9 @@ function searchRelatedTransactions(e, ID) {
var searchValue = $('#relatedSearchValue').val();
if (searchValue != '') {
$.post('related/search/' + ID, {searchValue: searchValue,_token:token}).success(function (data) {
// post each result to some div.
$('#relatedSearchResults').empty();
$.each(data, function (i, row) {
var tr = $('<tr>');
var checkBox = $('<td>').append($('<input>').attr('type', 'checkbox').data('relateto', ID).data('id', row.id).click(doRelateNewTransaction));
var description = $('<td>').text(row.description);
var amount = $('<td>').html(row.amount);
tr.append(checkBox).append(description).append(amount);
$('#relatedSearchResults').append(tr);
//$('#relatedSearchResults').append($('<div>').text(row.id));
});
// post the results to some div.
$('#relatedSearchResultsTitle').show();
$('#relatedSearchResults').empty().html(data);
}).fail(function () {
alert('Could not search. Sorry.');