autoUpload=false custom data fields

3 posts, 1 answers
  1. leblanc
    leblanc avatar
    56 posts
    Member since:
    Aug 2010

    Posted 14 Nov 2013 Link to this post

    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. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2211 posts

    Posted 15 Nov 2013 Link to this post

    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!
  3. Answer
    leblanc
    leblanc avatar
    56 posts
    Member since:
    Aug 2010

    Posted 15 Nov 2013 Link to this post

    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.
Back to Top