Tested and reconfigured ability to add files to the main corrective action form.

This commit is contained in:
Daniel Wathen
2023-02-20 15:24:27 -07:00
parent 2366bef0d3
commit 0dd3d4ec2a
20 changed files with 114 additions and 555 deletions

View File

@ -435,9 +435,19 @@
<div class="form-group">
<label class="control-label">Affected Documents:</label>
<div class="col-sm-12">
@(Html.Kendo().Upload()
.Name("files")
.Async(a => a
.Save("AttachSave", "CorrectiveAction", new { caNo = Model.CANo })
.AutoUpload(true)
)
.ShowFileList(false)
.Events(events => events
.Success("onFileUploadSuccess")
.Upload("CheckFileType")
.Error("onFileUploadError")
)
)
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.CA_Attachment>()
.Name("Attachments")
.Columns(columns =>
@ -452,7 +462,7 @@
columns.Command(command => command.Custom("Delete").Click("DeleteCAAttachment"));
})
.Scrollable()
.Sortable()
.HtmlAttributes(new { style = "height:300px; width:100%; font-size: 10px", Readonly = "Readonly" })
.DataSource(dataSource => dataSource
@ -465,7 +475,7 @@
model.Id(p => p.ID);
})
.PageSize(50)
.Read(read => read.Action("Attach_Read", "CorrectiveAction", new { caNO = Model.CANo }))
.Read(read => read.Action("Attachment_Read", "CorrectiveAction", new { caNO = Model.CANo }))
.Destroy(destroy => destroy.Action("DeleteCAAttachment", "CorrectionAction"))
)
)
@ -3947,8 +3957,16 @@
}
function onFileUploadSuccess(e) {
//alert(e.message);
var grid = $("#Attachments").data("kendoGrid");
grid.dataSource.read($('#txtCANo').val());
}
function onFileUploadError(e) {
alert("Error Uploading File!!! Please Try Again...");
var grid = $("#Attachments").data("kendoGrid");
grid.dataSource.read($('#txtCANo').val());
}
function onD4FileUploadSuccess(e) {
var grid = $("#D4Attachments").data("kendoGrid");