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

Adding custom controls to upload window in rad file explorer

2 Answers 132 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Priya
Top achievements
Rank 1
Priya asked on 24 Jul 2012, 01:07 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 25 Jul 2012, 07:42 AM
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.
0
Vessy
Telerik team
answered on 25 Jul 2012, 10:39 AM
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.
Tags
FileExplorer
Asked by
Priya
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Vessy
Telerik team
Share this question
or