New Folder & Rename Dialog - Highlight Text

4 posts, 0 answers
  1. Jacob Button
    Jacob Button avatar
    5 posts
    Member since:
    Jan 2010

    Posted 08 Sep Link to this post

    Apologies if this has already been addressed.

    Is there a way to intercept and access the dialog box that opens when Rename or New Folder is clicked?  I'd like to select the text in the textbox (minus file extension if applicable) when the dialog box opens.

    I've gotten feedback from my users who are frustrated with the current text box behavior of inserting text before "New Folder" or "[Existing File/Folder Name]" rather than replacing it when they begin typing after hitting Rename/New Folder as they expect because that's the behavior they're used to with Windows Explorer.

  2. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 13 Sep Link to this post

    Hi Jacob,

    Here is a code example that you can use to customize the File Explorer and achieve your goal:

    <telerik:RadFileExplorer RenderMode="Lightweight" runat="server" ID="FileExplorer1" OnClientLoad="OnClientLoad">
        <Configuration ViewPaths="~/Images" UploadPaths="~/Images" DeletePaths="~/Images"></Configuration>
    </telerik:RadFileExplorer>
    <script type="text/javascript">
        function OnClientLoad(fileExplorer) {
            fileExplorer.get_windowManager().add_show(function (promptDialog) {
     
                if (promptDialog.get_title() == "Rename" || promptDialog.get_title() == "Enter the new folder name") {
     
                    $telerik.$(".rwPromptInput").on('focus', function (e) {
                        $(this)
                            .one('mouseup', function () {
                                $(this).select();
                                return false;
                            })
                            .select();
                    });
                }
            });
        }
    </script>

    Feel free to modify the code to better cover your specific customer requirements.

    Regards,
    Rumen
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jacob Button
    Jacob Button avatar
    5 posts
    Member since:
    Jan 2010

    Posted 13 Sep in reply to Rumen Link to this post

    Rumen, 

    Thanks for the response. I'm still having a few issues.

     

    $(".rwPromptInput").on('focus')

    didn't seem to do anything. I had to change it too 

    $(".rwDialogInput").on('focus')

    and that seemed to do that trick, but we're still not quite there.

    This only fires on the first radwindow to open on the page (the first rename, or the first new folder), id does not fire on any subsequent rename or new folder there after until the page is reloaded. Can we do anything about that?

     

  5. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 16 Sep Link to this post

    Hello,

    I didn't get such issue on my end as you can see in this video: http://screencast.com/t/GfSqCNmkW3UQ.

    For your convenience I have attached my project.

    Regards,
    Rumen
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top