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

RadUpload - MaxFileInputsCount includes additional fields in count

1 Answer 43 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Marbry
Top achievements
Rank 1
Marbry asked on 25 Aug 2011, 07:10 PM
I would think that the MaxFileInputsCount would be the count of actual files allowed, but not always.  As with the example below, adding a description field, the count is apparently twice the number of actual file inputs added.

So to allow 5 file inputs for example, you would need to set MaxFileInputsCount to 10 in this particular case.

I'm assuming this is from the addition of the description field, I haven't tested it with other scenarios using additional fields.


function OnClientAddedHandler(sender, eventArgs)
{
    var inputRow = eventArgs.get_row();
    var uList = inputRow.parentNode;
    var count = 0;
    // add a new row for the description field
    newRow = document.createElement("li");
    count++;
    uList.insertBefore(newRow, inputRow);
    var label = document.createElement("span");
    label.innerHTML = "Description: ";
    label.style.fontSize = 12;
    label.id = label.name = sender.getID("DescLabel");
    input = document.createElement("input");
    input.type = "text";
    input.id = input.name = sender.getID("DescValue");
    newRow.appendChild(label);
    newRow.appendChild(input);
}

1 Answer, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 30 Aug 2011, 09:07 AM
Hello Marbry,

I reproduced your issue. It happens because you create "li" elements and append them before the "inputRow" element.

Please review the following video. To avoid that issue use the approach implemented in our demo.

Kind regards,
Peter Filipov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Upload (Obsolete)
Asked by
Marbry
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Share this question
or