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

'file' input missing if disabled server side

1 Answer 39 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
ANDREW
Top achievements
Rank 1
ANDREW asked on 27 Jun 2013, 07:14 AM
Hi,

I'm having an issue with the RadAsyncUpload control where if the control is disabled on the server side, then enabled on the client side, the 'Select' button doesn't work.

I have narrowed this down to the <input type="file" class="ruFileInput" id="....file0" .....> element not being rendered when disabled on the server side.

If I manually add what that element 'should' be (including it's name/id etc) then it starts working as expected.

Serverside I am calling control.Enabled = false;

Clientside I am calling jsControl.set_enabled(true);

On the same topic, by disabling the control server side, the following other elements appear to get left out too (although they don't appear to affect my use of the control):

* List item's ID (<li>) -> id="....row0"
* 'file' input (described above)
* label for='....file0'
* 'ruDropZone' div

Can you give any suggestions as how to be disable this control serverside while still being able to use it after re-enabling client side? I have considered handling all disabling/enabling client side which would probably work ok but it seemed a bug for it not to work the way I have described??

Cheers,

Andrew

1 Answer, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 02 Jul 2013, 10:07 AM
Hi Andrew,

Yes, this is a bug which I have logged. Until we resolve it you may use the following workaround:
function enableRadAsyncUpload() {
    var upload = $find('RadAsyncUpload1');
    upload.set_enabled(true);
    upload.addFileInput();
    upload.deleteFileInputAt(0);
}

Regards,
Hristo Valyavicharski
Telerik
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 the blog feed now.
Tags
AsyncUpload
Asked by
ANDREW
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Share this question
or