Finding out any changes to the RadAsyncUpload control by user or not? (Any file added/updated/deleted)

3 posts, 0 answers
  1. Mohinder Goswami
    Mohinder Goswami avatar
    24 posts
    Member since:
    Nov 2008

    Posted 24 Jun Link to this post

    Hi,
    I want to find out changes to the controls on the form if any element is changed but without saving it if the user moves to the other pages I want to show the user to ‘some unsaved changes are there do you want to save it or not?’ something like to show to the user. For archiving this I am using the JavaScript. With this I was able to find out any changes to all the controls on the form except RadAsyncUpload control.
    Can you please advise how can I find out the changes to this RadAsyncUpload control using javascript?
    Thanks,
  2. Mohinder Goswami
    Mohinder Goswami avatar
    24 posts
    Member since:
    Nov 2008

    Posted 24 Jun in reply to Mohinder Goswami Link to this post

    Any update?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ivan Danchev
    Admin
    Ivan Danchev avatar
    835 posts

    Posted 29 Jun Link to this post

    Hello Mohinder,

    I am not sure exactly what changes to the RadAsyncUpload you aim at tracking, but you can listen for changes in its rendered elements with the help of the Mutation Observers. For example if the ID of your control is "RadAsyncUpload1" you can pass it to the observe method as shown below:
    function pageLoad() {
        var target = document.getElementById('RadAsyncUpload1');
     
        MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
     
        var observer = new MutationObserver(function (mutations, observer) {
            console.log(mutations, observer);
            // ...
        });
     
        observer.observe(target, {
            subtree: true,
            attributes: true
            //...
        });
    }


    Regards,
    Ivan Danchev
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top