Articles in this section
Category / Section

How to use Client-side methods of EJ controls?

1 min read

Description

You can use the Client-side methods of the controls by accessing it with the use of object creation for the control in the script section.

Solution

You have to render the MaskEdit control with the FocusOut event in the View page as shown in the following code example.

View

@Html.EJ().MaskEdit("Code").MaskFormat("999-999").ClientSideEvents(e => e.FocusOut("CodeOnFocusOut"))

You have to create an object for the control and by using the object you can access the Methods as shown in the following code example.

Script

function CodeOnFocusOut() {
        var obj = $("#Code").data("ejMaskEdit");
        var value = obj.get_StrippedValue();
        alert(value);
    }

Created here is the MaskEdit control in the View page with the Client-side on FocusOut event. In that event you can access the method by creating an object to the MaskEdit control as shown in the above code example. Also you can refer the following blog for more details.

http://www.syncfusion.com/blogs/post/Introduction-to-Essential-JavaScript.aspx

Sample:

http://www.syncfusion.com/uploads/user/directTrac/138353/Maskedit-480960637.zip

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied