mirror of
https://github.com/grocy/grocy.git
synced 2025-08-21 04:43:32 +00:00
Reorganize project part 1
This commit is contained in:
38
views/viewjs/shoppinglist.js
Normal file
38
views/viewjs/shoppinglist.js
Normal file
@@ -0,0 +1,38 @@
|
||||
$(document).on('click', '.shoppinglist-delete-button', function(e)
|
||||
{
|
||||
Grocy.FetchJson('/api/delete-object/shopping_list/' + $(e.target).attr('data-shoppinglist-id'),
|
||||
function(result)
|
||||
{
|
||||
window.location.href = '/shoppinglist';
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
console.error(xhr);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$(document).on('click', '#add-products-below-min-stock-amount', function(e)
|
||||
{
|
||||
Grocy.FetchJson('/api/stock/add-missing-products-to-shoppinglist',
|
||||
function(result)
|
||||
{
|
||||
window.location.href = '/shoppinglist';
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
console.error(xhr);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$(function()
|
||||
{
|
||||
$('#shoppinglist-table').DataTable({
|
||||
'pageLength': 50,
|
||||
'order': [[1, 'asc']],
|
||||
'columnDefs': [
|
||||
{ 'orderable': false, 'targets': 0 }
|
||||
]
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user