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

autoUpload=false custom data fields

2 Answers 190 Views
Upload
This is a migrated thread and some comments may be shown as answers.
leblanc
Top achievements
Rank 1
leblanc asked on 15 Nov 2013, 01:30 AM
Attached is the latest UI i'm developing to manage our attachments.

UI Description:
The UI is not wrapped in a form element.
'Select file' is a custom command on the toolbar on the Grid with a custom template being the kendo upload control. (autoUpload=false)
The Grid is grouped by 'Component Type'.
Reset and Save Changes are working buttons that work with our model to ensure validation.


Once we attach a file the generated kendo button $(".k-upload-selected") when manually clicked Calls our onUpload method.
When we try to wrap it behind Save Changes button like in our UI - onUpload is not called when invoked with
$(".k-upload-selected").click();  

So how can i make it work when invoked through javascript?
$(".k-upload-selected").click();   what am i missing?






2 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 15 Nov 2013, 08:25 AM
Hello,


I am unable to reproduce the behavior on my side. Could you provide an example of this and specify in which browser are you observing the behavior, so I could assist you further?

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Accepted
leblanc
Top achievements
Rank 1
answered on 15 Nov 2013, 07:25 PM
i was using kendo-angularjs project - seems i need to add a timeout to make it work


        $scope.onUpload = function (e) {
            $scope.IsBusySubmitting = true;
            e.data = {
      ........
            };
        };

// my custom button action
        $scope.AttachmentAddOrEdit = function (submitEvent) {
            $timeout(function () {
                $(".k-upload-selected").click();
                $timeout(function () {
                    submitEvent.Deferred.resolve({});
                }, 1000);
            }, 10);
        };

once i added the timeout - it started to work as expected.
Tags
Upload
Asked by
leblanc
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
leblanc
Top achievements
Rank 1
Share this question
or