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.

decimalPlaces

Thread ID:

Created:

Updated:

Platform:

Replies:

124638 Jun 20,2016 09:08 AM Nov 21,2016 07:20 AM JavaScript 8
loading
Tags: ejPercentageTextbox
Tyeth Gundry
Asked On June 20, 2016 09:08 AM

Hi, is it possible to return the full number stored in the field, ie to 8decimals for example, even though the user only sees 2 decimal places? 
Currently the requested decimalPlaces defines the returned POST variable precision, but in the event of no-change I need the original value returned.
My intended use is in a viewmodel when comparing for changes with a collection of datarows or equivalent.

Ashokkumar Balasubramanian [Syncfusion]
Replied On June 21, 2016 10:17 AM

Hi Tyeth, 
 
Thanks for your update. 
 
We have prepared a sample based on your requirement (“Is it possible to return the full number stored in the field, ie to 8 decimals for even though the user only sees 2 decimal places?”) for ejPercentageTextbox control. We have achieved this by getting the value from internal variable. Please refer the sample in below link. 
 
Please let us know whether the provided sample helps you to achieve your requirement. If not, then get back to us with more information we will assist you gladly. 
  
Regards, 
Ashokkumar B.

Tyeth Gundry
Replied On June 21, 2016 01:10 PM

Thats brilliant, thanks.
 I presume to get these values back into my asp.net MVC model, I would have to trap the form submit event, and then go through updating the hidden fields with the respective _pre values?

Ashokkumar Balasubramanian [Syncfusion]
Replied On June 22, 2016 11:01 AM

Hi Tyeth, 
Thanks for your update. 
We have prepared a sample based on your requirement. Please refer the below sample. 
Sample Location:  sample  
In the above sample, we have created the hidden element for maintaining the previous value of percentage text box. You can get this previous value of percentage text box in form post back, after the form gets submitted.  
Please refer the below code snippet: 
[CSHTML] 
 
@using (Html.BeginForm()) 
{ 
            @Html.EJ().PercentageTextbox("percent").Value("100").DecimalPlaces(2).ClientSideEvents(evt=>evt.FocusOut("onfocusout")) 
            <br /> 
            @Html.EJ().Button("submit").Type(ButtonType.Submit).Size(ButtonSize.Medium) 
            @Html.Hidden("preval") 
} 
 
[SCRIPT] 
function onfocusout () { 
        $("#preval").val(this._preVal) 
} 
 
[CONTROLLER] 
 
     [HttpPost] 
     public ActionResult TextBoxesFeatures(string preval) 
     { 
            return View(); 
     } 
 
Please let us know whether the provided sample helps you to achieve your requirement. If not, then get back to us with more information we will assist you gladly. 
 
Regards, 
Ashokkumar B

Tyeth Gundry
Replied On November 17, 2016 02:55 PM

Massive problems in EDGE browser. When first clicked inside the input in the JS sample provided, I cannot use the keyboard to navigate through the characters until I click again somewhere in the input usually on the number. I tried initially clicking at the decimal point instead of either side of the number, but it all seems broken until I click the second time.

Tyeth Gundry
Replied On November 17, 2016 03:10 PM

Massive problems in EDGE browser. When first clicked inside the input in the JS sample provided, I cannot use the keyboard to navigate through the characters until I click again somewhere in the input usually on the number. I tried initially clicking at the decimal point instead of either side of the number, but it all seems broken until I click the second time.

Updated the library and same issue...

Gobalakrishnan S [Syncfusion]
Replied On November 18, 2016 08:16 AM

Hi Tyeth,  
We are unable to reproduce the reported issue (“When first clicked inside the input in the JS sample provided, I cannot use the keyboard to navigate through the characters until I click again somewhere in the input usually on the number”) in our end.  
Could you please share the below details? 
1.       Browser IE Version 
2.       Is any error thrown in console window? If yes, share the screenshot of the error. 
Please provide the requested details so that it would be helpful for us to analyze the cause of the error and provide you a better solution.  
Please let us know, if you have any concern. 
Regards, 
Gobalakrishnan S 


Tyeth Gundry
Replied On November 18, 2016 09:42 AM

Browser reports:
Lastest version of EDGE Browser
Microsoft Edge 38.14393.0.0
Microsoft EdgeHTML 14.14393

Windows:
Latest Windows 10 Pro, with all updates, but on the Defer path instead of Insider Updates.

https://www.youtube.com/watch?v=nG8S02i0XWQ

Ashokkumar Balasubramanian [Syncfusion]
Replied On November 21, 2016 07:20 AM

Hi Tyeth,  
 
Thank you for providing the details. 
  
We have considered this When first clicked inside the input in the JS sample provided, I cannot use the keyboard to navigate through the characters until I click again somewhere in the input usually on the number as an issue and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.  
  
 
Regards,  
Ashokkumar B. 


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.

;