Adding custom controls to upload window in rad file explorer

3 posts, 1 answers
  1. Priya
    Priya avatar
    2 posts
    Member since:
    Jul 2012

    Posted 24 Jul 2012 Link to this post

    Hello,


    I want to add a custom checkbox on the Upload window, checking/unchecking of which will decide something related to documents.
    Is that possible somehow?

    Regards,
    Priya Angolkar 
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 25 Jul 2012 Link to this post

    Hi Priya,

    RadFileExplorer does not offer functionality to modify the Upload dialog. Nevertheless, you can achieve this by adding a <CheckBox> element to upload dialog. You could use JavaScript and JQuery for the implementation.Here is the sample code.

    ASPX:
    <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" OnClientLoad="addTitle" Configuration-EnableAsyncUpload="true">
      <Configuration ViewPaths="~/" UploadPaths="~/" DeletePaths="~/" />
    </telerik:RadFileExplorer>

    JS:
    <script type="text/javascript">
        $(document).ready(function (event) {
            $('#id').bind('click', function () {
                if ($('#id').is(':checked')) {
                    alert('Checkbox is checked ');//Your code
                }
                else {
                    alert('Checkbox is unchecked '); //Your code
                }
            });
        });
        function addTitle(explorer, args) {
            var upload = $find(explorer.get_id());
            var uploadEl = upload.get_element();
            var spanelems = uploadEl.getElementsByClassName("ruInputs");
            var currentSpan = spanelems[0];
            var checkbox = document.createElement('input');
            checkbox.type = "checkbox";
            checkbox.name = "name";
            checkbox.value = "value";
            checkbox.id = "id";
            currentSpan.parentNode.insertBefore(checkbox, currentSpan);
            currentSpan.parentNode.insertBefore(document.createElement("br"), currentSpan);
        }
    </script>

    Hope this helps.

    Regards,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vessy
    Admin
    Vessy avatar
    1388 posts

    Posted 25 Jul 2012 Link to this post

    Hi,

    Although the suggested JavaScript solution seems proper to me, you also may find useful the following forum thread, where such scenario has been discussed: Custom Upload File Fields.

    All the best,
    Veselina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top