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

LostFocus event in custom dialog with ejCurrencyTextbox

Thread ID:

Created:

Updated:

Platform:

Replies:

141162 Nov 27,2018 03:59 PM UTC Nov 29,2018 06:03 AM UTC ASP.NET Web Forms 3
loading
Tags: CurrencyTextbox
Yukiko Imazu
Asked On November 27, 2018 03:59 PM UTC

Hello,

I'm trying to implement LostFocus event in custom dialog by using forcusout event in JS for ASP.Net web forms.
It is just a simple event adding numbers and set total number in total column.
If total column were not ejCurrencyTextbox, it works perfectly.
Sub A + Sub B value goes to Total column.


If total control were ejCurrencyTextbox, it doesn't work.


I've attached sample solution.  



If row 229-233 were commented out, it works well, but I need to set control as ejCurrencyTextbox.
Could you please tell me where my code is wrong?

Regards,
Yukiko


Attachment: test_21853165.7z

Christopher Issac Sunder K [Syncfusion]
Replied On November 28, 2018 11:40 AM UTC

Hi Yukiko, 

Thank you for contacting Syncfusion support. 

Our currency textbox have inbuilt support for focusOut event. Instead of using element’s focusout event, you can make use of the component’s focusOut event. Here is the modified code snippet, 

$("#SubA").ejCurrencyTextbox({ 
    decimalPlaces: 2, 
    showSpinButton: false, 
    watermarkText: "$0.00", 
    //Bind the focusOut event for CurrencyTextBox  
    focusOut: "calculateTotal" 
}); 
$("#SubB").ejCurrencyTextbox({ 
    decimalPlaces: 2, 
    showSpinButton: false, 
    watermarkText: "$0.00", 
    //Bind the focusOut event for CurrencyTextBox  
    focusOut: "calculateTotal" 
}); 
$("#Total").ejCurrencyTextbox({ 
    decimalPlaces: 2, 
    showSpinButton: false, 
    watermarkText: "$0.00" 
}); 
//LostFocus event for both SubA and sub B currency textbox  
function calculateTotal() { 
    // Instance for SubA CurrencyTextBox, it’s used to access the value to that textbox 
    var subAObj = $("#SubA").ejCurrencyTextbox("instance"); 
    // Instance for SubB CurrencyTextBox, it’s used to access the value to that textbox 
    var subBObj = $("#SubB").ejCurrencyTextbox("instance"); 
    // Instance for Total CurrencyTextBox, it’s used to access the value to that textbox 
    var totalObj = $("#Total").ejCurrencyTextbox("instance"); 
    //Using instance to get the values and add it 
    var total = subBObj.model.value + subAObj.model.value; 
    //Update the total values to Total currency textbox 
    totalObj.option("value", total); 
}               


To know more details about CurrencyTextBox component properties, methods and events, please check the below API document. 


To know more details about Accessing Syncfusion components, please check the below help document. 



Please let us know if you need any further assistance. 

Thanks,
Christo


Yukiko Imazu
Replied On November 28, 2018 07:14 PM UTC

Hi Christo,

Thank you for your support.
We could achieve our requirement.


Regards,
Yukiko

Christopher Issac Sunder K [Syncfusion]
Replied On November 29, 2018 06:03 AM UTC

Hi Yukiko, 

We are glad to hear that the issue has been resolved at your end. Please let us know if you need any further assistance. 

Thanks,
Christo


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

;