Apply publish/subscribe for OrderArticle#create
This commit is contained in:
parent
5349ee142e
commit
59c118a171
6 changed files with 35 additions and 3 deletions
|
|
@ -11,6 +11,15 @@
|
|||
contentType: 'application/json; charset=UTF-8'
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('OrderArticle#create', function(e) {
|
||||
$.ajax({
|
||||
url: '#{new_on_order_article_create_finance_order_path(@order)}',
|
||||
type: 'get',
|
||||
data: {order_article_id: e.order_article_id},
|
||||
contentType: 'application/json; charset=UTF-8'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
- title t('.title', name: @order.name)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
// Handle more advanced DOM update after AJAX database manipulation.
|
||||
// See publish/subscribe design pattern in /doc.
|
||||
(function(w) {
|
||||
$('#result_table').prepend(
|
||||
'<%= j render('finance/balancing/order_article_result', order_article: @order_article) %>'
|
||||
);
|
||||
|
||||
$('#summaryChangedWarning').show();
|
||||
})(window);
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue