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.
Unfortunately, activation email could not send to your email. Please try again.

Set Focus to an angular DropDownList

Thread ID:

Created:

Updated:

Platform:

Replies:

119368 Jun 11,2015 06:05 AM Jun 12,2015 10:09 AM JavaScript 1
loading
Tags: ejDropDownList
Rob ONeill
Asked On June 11, 2015 06:05 AM

Hi,
I am trying to set the focus to a DropDownList when a partial view is loaded. It doesn't seem to get the focus. We are using an ng-include to return the partial view, and within that template html I need to set the focus to a dropdownlist contained within. Any thoughts ?

Cheers ... Rob.

Harikrishnan P [Syncfusion]
Replied On June 12, 2015 10:09 AM

Hi Rob,

Thanks for using Syncfusion products. We have analyzed your query and prepared the sample based on your requirement .Please get the sample from below location

Sample

In this sample, we have maintained the dropdown list in page2.html which will load in main page using ng-include. The page will load when you click on the button in main page.
To set the focus to control, we have used ‘$includeContentLoaded’ event which will trigger after the ng-include src page loaded success fully.

Please refer the below code snippet

$scope.$on("$includeContentLoaded", function (event, templateName) {

 

if (($(".e-dropdownlist").length > 0))

    $($(".e-dropdownlist")[0]).focus();

            });


Please check with the provided samples and let us know if it helps. If we misunderstood your queries, please provide more details about the requirement that will be easy for us to provide the exact solution

Regards,
HariKrishnan


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.

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.

;