We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

focus setting on custom dialog

Thread ID:

Created:

Updated:

Platform:

Replies:

143139 Mar 5,2019 06:27 PM UTC Mar 11,2019 06:36 AM UTC ASP.NET Web Forms 8
loading
Tags: Grid
Yukiko Imazu
Asked On March 5, 2019 06:27 PM UTC

Hello,

I'm working on custom dialog and I want to set up default focus on a specific column which is blank column below.












I wrote this code but doen't work.

             var numeric = $("#blank").ejNumericTextbox("instance");  
                numeric._hiddenInput.focus();   



I attach my sample code.  Could you please let me know what's wrong is my code?

Regards,
Yukiko



Yukiko Imazu
Replied On March 5, 2019 06:28 PM UTC

Here's my sample solution

Attachment: test_7d16e270.7z

Vignesh Natarajan [Syncfusion]
Replied On March 6, 2019 10:33 AM UTC

Hi Yukiko, 
 
Thanks for using Syncfusion products. 
 
Query: “I want to set up default focus on a specific column which is blank column below” 
 
From your query, we understand that you need to focus the blank input element in the Dialog template of ejGrid. We have achieved your requirement using open event of ejDialog. Refer the below code example 
 
function onGridActionCompleteEvent(args) { 
……………………………………………………….. 
            if (args.model.editSettings.editMode == "dialogtemplate") { 
……………………………………………………………………………. 
 
                $.ajax({ 
                    type: "POST", 
                    url: "Default.aspx/DropDown", 
                    contentType: "application/json; charset=utf-8", 
                    dataType: "json", 
                    success: function (value) { 
                      
                        $("#priceId").ejDropDownList({ 
                            dataSource: value.d, 
                            fields: { value: "priceId", text: "price1" }, 
                            width: "100%" 
                        }); 
                     
                    }, 
                    error: function (e) { 
                        alert(e); 
                    } 
                }); 
 
                var dia = $('#<%= Grid1.ClientID %>'+"_dialogEdit").ejDialog("instance") // take instance of ejDialog  
                dia.setModel({ 
                    //bind open event to ejDialog 
                    open: function (args) {                        
                            var numeric = $("#blank").ejNumericTextbox("instance");    
                            numeric.element.siblings('input:visible').focus(); // focus the input element                   
                    } 
                    }) 
 
            } 
} 
    } 
 
Refer the below screenshot for the output 
 
 
 
 
Refer our API documentation for your reference 
 
 
Please get back to us if you have further queries. 
 
Regards, 
Vignesh Natarajan. 
 


Yukiko Imazu
Replied On March 6, 2019 02:51 PM UTC

Hi Vignesh,

Thank you for your support.
We were able to achieve out requirement.

Regards,
Yukiko

Vignesh Natarajan [Syncfusion]
Replied On March 7, 2019 04:23 AM UTC

Hi Yukiko, 

Thanks for the update. 

We are glad to hear that your query has been resolved  by our solution.  

Please get back to us if you have further queries.  

Regards, 
Vignesh Natarajan. 


Yukiko Imazu
Replied On March 7, 2019 09:07 PM UTC

Hi,

I also have one more question.

Is it possible to show dialog without any focus on any columns?
How do we remove default focus setting on the dialog?

Regards,
Yukiko

Vignesh Natarajan [Syncfusion]
Replied On March 8, 2019 10:26 AM UTC

Hi Yukiko, 
 
Query: “How do we remove default focus setting on the dialog?” 
 
We have achieved your query to remove the focus from ejDialog edit form by blur() method. Reefer the below code example 
 
function onGridActionCompleteEvent(args) { 
………………………………………………………………. 
 
                $.ajax({ 
……………………………………………………….. 
                }); 
 
                 var dia = $('#<%= Grid1.ClientID %>'+"_dialogEdit").ejDialog("instance") 
                dia.setModel({ 
                    //bind open event to ejDialog 
                    open: function (args) {                        
                        var numeric = $("#SubA").ejCurrencyTextbox("instance");    
                        numeric.element.blur();                 
                    } 
                    }) 
   } 
    } 
} 
 
Please get back to us if you have further queries. 
 
Regards, 
Vignesh Natarajan. 


Yukiko Imazu
Replied On March 8, 2019 02:40 PM UTC

Hi Vignesh,

Thank you for your response.
Our issue was resolved.

Best Regards,
Yukiko

Vignesh Natarajan [Syncfusion]
Replied On March 11, 2019 06:36 AM UTC

Hi Yukiko, 
 
Thanks for the update.  
 
We are glad to hear that your query has been resolved by our solution. 
 
Please get back to us if you have further queries. 
 
Regards, 
Vignesh Natarajan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;