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

[Solved] Additional fields to appear alongside fileselector

3 Answers 87 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
540YMX
Top achievements
Rank 1
540YMX asked on 22 May 2009, 05:49 PM
As the title, is there a way to add a custom field so it appears to the left of the file selector rather than underneath?

When uploading multiple files which have different ref numbers it looks a lot better when it is

Ref No     Filename
======================
12345     UploadedFile1.doc
54321     UploadedFile2.doc
11133     UploadedFile3.doc

Rather than

FileName UploadedFile1.doc
Ref No     12345
Filename UploadedFile2.doc
Ref No    54321
FileName UploadedFile3.doc
Ref No    11133

Have searched the samples etc but not found anything relating to this.

Thanks

3 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 25 May 2009, 04:31 PM
Hi 540YMX,

You can use the following syntax to achieve this functionality ( using jQuery ):
function onClientAddedHandler(sender, args) 
        { 
            var idAddField = sender.getID("additional"); 
            $(".ruInputs li[class='']:last span").before( 
                $("<input type='text' />").attr( "id", idAddField ).attr("name", idAddField)); 
                 
        } 

Please keep in mind that jQuery now ships with the Telerik dll, so there is no need for third party resources.

Sample project is attached for reference.

Greetings,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
540YMX
Top achievements
Rank 1
answered on 25 May 2009, 06:52 PM
Thanks, exactly what I am after.

I can only make this work using the Q1 2009, can this be tweaked to work with Q3 2008?
0
Genady Sergeev
Telerik team
answered on 28 May 2009, 06:46 AM
Hi 540YMX,


Yes, there is no problem to use the down mentioned workaround with Q3 2008. Modify the ScriptManager declaration like this:

<asp:ScriptManager runat="server" ID="ScriptManager1">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
        </Scripts>
    </asp:ScriptManager>

and the javascript code:

<script type="text/javascript"
        var $ = $telerik.$; 
        function onClientAddedHandler(sender, args) 
        { 
            var idAddField = sender.getID("additional"); 
            $(".ruInputs li[class='']:last span").before( 
                $("<input type='text' />").attr( "id", idAddField ).attr("name", idAddField)); 
                 
        } 
    </script> 

This should work with Q3 2008. Sample is attached.

Regards,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Upload (Obsolete)
Asked by
540YMX
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
540YMX
Top achievements
Rank 1
Share this question
or