Unplanned
Last Updated: 29 Aug 2021 10:01 by ADMIN
Created by: Aleksandr
Comments: 0
Category: Dialog
Type: Feature Request
2

I want to fill the textbox of the prompt with predefined text, can we have that same behavior like in kendo https://docs.telerik.com/kendo-ui/api/javascript/kendo/methods/prompt?

 

---------

ADMIN EDIT

Here is a workaround

@inject IJSRuntime _js

<TelerikButton OnClick="@PromptWithText">Workaround</TelerikButton>

@code{
    [CascadingParameter]
    public DialogFactory Dialogs { get; set; }

    async Task PromptWithText()
    {
        // the workaround - invoke a script that will set the input value with a delay
        await _js.InvokeVoidAsync("setPromptDefaultText", "predefined prompt value");

        // do the prompts as usual
        string prompt = await Dialogs.PromptAsync("Enter something");
        Console.WriteLine(prompt);
    }
}

@* move this script to a proper location, this is a hack 
    to put in the blazor component so the workaround is easy to copy and run *@
<script suppress-error="BL9992">
    function setPromptDefaultText(defText) {
        setTimeout(function(){
            var promptInput = document.querySelector(".k-prompt-container input.k-textbox");
            if(promptInput) {
                promptInput.value = defText;
                promptInput.dispatchEvent(new Event('input', {bubbles: true} ));
            }
        }, 50); // a timeout so the prompt can render first
    }
</script>

---------

Unplanned
Last Updated: 25 Aug 2021 14:32 by ADMIN
Created by: Chris
Comments: 0
Category: Dialog
Type: Feature Request
2
I would like to easily mock the DialogFactory.
Unplanned
Last Updated: 20 Aug 2021 08:13 by ADMIN
Created by: Dan
Comments: 0
Category: Dialog
Type: Feature Request
3
Pressing the Enter key should trigger the Ok button in the Prompt Dialog
Unplanned
Last Updated: 09 Jul 2021 10:00 by ADMIN
Created by: Raventhorn
Comments: 1
Category: Dialog
Type: Feature Request
7
Would be great to have the ability to customize the text of the Dialog Factory buttons, especially for Confirmation. We could use a Custom window but all we need to do is change the buttons and the Dialogs feature is perfect.
Unplanned
Last Updated: 27 Jun 2021 10:24 by ADMIN

 <AdminEdit>

This feature request would be used to monitor the requests for a full-fledged Dialog component. It will be defined in the Markup and will provide options to customize the Header and Content and will expose Action buttons.

</AdminEdit>

Unplanned
Last Updated: 21 Jun 2021 06:59 by ADMIN
Created by: Guy
Comments: 0
Category: Dialog
Type: Feature Request
1
I would like to use a similar parameter to the RestrictionZoneID in AJAX - https://demos.telerik.com/aspnet-ajax/window/examples/restrictionzone/defaultcs.aspx
Completed
Last Updated: 18 May 2021 06:07 by ADMIN
It I possible to customize the Dialog component (e.g Yes/No instead of OK/Cancel)?
Unplanned
Last Updated: 07 May 2021 00:29 by Baires
Created by: Yuri
Comments: 1
Category: Dialog
Type: Feature Request
5

Can I define the Cancel home button by default? When deleting a line I use Confirm Dialogs, I want the default (active) button to be Cancel (not Ok)

---

ADMIN EDIT

Here is a solution you can use:

@inject IJSRuntime _js

@* move this script to a proper place in your project and remove the 
    suppress-error hack that lets it stay in the component - it is here for brevity only *@
<script suppress-error="BL9992">
    function focusCancelDialogButton() {
        setTimeout(function() {
            var cancelButtons = document.querySelectorAll(".k-dialog .k-dialog-buttongroup .k-button");
            if(cancelButtons && cancelButtons.length > 1) {
                cancelButtons[1].focus();
            }
        }, 100);
    }
</script>

<TelerikButton OnClick="@ShowConfirm">Show Confirm</TelerikButton>

@code {
    [CascadingParameter]
    public DialogFactory Dialogs { get; set; }

    public async Task ShowConfirm()
    {
        await _js.InvokeVoidAsync("focusCancelDialogButton");
        bool isConfirmed = await Dialogs.ConfirmAsync("Are you sure?");

        if (isConfirmed)
        {
            Console.WriteLine("The user is sure, continue.");
        }
        else
        {
            Console.WriteLine("The user changed their mind");
        }
    }
}

---