mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
(cherry picked from commit b3dcc28bd9
)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
parent
feb2acf668
commit
cf5d637678
@ -281,10 +281,20 @@ function loadAttachmentTable(url, options) {
|
|||||||
sidePagination: 'server',
|
sidePagination: 'server',
|
||||||
onPostBody: function() {
|
onPostBody: function() {
|
||||||
|
|
||||||
|
// Add callback for 'delete' button
|
||||||
|
if (permissions.delete) {
|
||||||
|
$(table).find('.button-attachment-delete').click(function() {
|
||||||
|
let pk = $(this).attr('pk');
|
||||||
|
let attachments = $(table).bootstrapTable('getRowByUniqueId', pk);
|
||||||
|
|
||||||
|
deleteAttachments([attachments], url, options);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Add callback for 'edit' button
|
// Add callback for 'edit' button
|
||||||
if (permissions.change) {
|
if (permissions.change) {
|
||||||
$(table).find('.button-attachment-edit').click(function() {
|
$(table).find('.button-attachment-edit').click(function() {
|
||||||
var pk = $(this).attr('pk');
|
let pk = $(this).attr('pk');
|
||||||
|
|
||||||
constructForm(`${url}${pk}/`, {
|
constructForm(`${url}${pk}/`, {
|
||||||
fields: {
|
fields: {
|
||||||
|
Loading…
Reference in New Issue
Block a user