This is a migrated thread and some comments may be shown as answers.

Close "edit window" after a file is uploaded

1 Answer 99 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Yaiton
Top achievements
Rank 1
Yaiton asked on 16 Feb 2013, 04:32 AM
Hi,
I have a grid with a popup edit and I want to be able to upload file, update the current record then close the edit window. I'm calling the "Update button" trigger but that doesn't seem to work. Here's my code:

...
      @(Html.Kendo().Grid<MyProject.Models.FileDetail>()
...
     .Editable(editable =>
            {
                editable.Mode(GridEditMode.PopUp);
                editable.TemplateName("template");
               editable.Window(w => w.Title("file upload").Name("UploadWindow"));
            })
.....

/*template.cshtml */

@model MyProject.Models.FileDetail
<div style="width: 400px">
    <div>Title:</div>
    <div>@Html.EditorFor(m => m.Title)</div>
    @(Html.Kendo().Upload()
        .Name("files")
        .Events(e => e
          .Success(@<text>
    function() {
             $(".k-grid-update").trigger('click');
            }
            </text>)
      )
        .Async(a => a.Save("Save", "Upload").Remove("Remove", "Upload").AutoUpload(false)
    ))
</div>

Is this possible or should I use a different approach to accomplish this?

Thank you.

-Yai

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimiter Madjarov
Telerik team
answered on 19 Feb 2013, 12:57 PM
Hi Yaiton,

This is a quote from my answer in the support thread:

I tried to reproduce the problem that you are describing, but to no avail. I am attaching the sample project that I used for testing to my answer. Could you take a look at it and check if it covers your scenario? If that is not the case, please modify it to reproduce the issue and send it back to me to assist you further.

 
Wish you a great day!

All the best,
Dimiter Madjarov
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Upload
Asked by
Yaiton
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or