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. Image for the cookie policy date

decimalPlaces

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.

8 Replies

AB Ashokkumar Balasubramanian Syncfusion Team June 21, 2016 02:17 PM UTC

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.


TG Tyeth Gundry June 21, 2016 05:10 PM UTC

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?


AB Ashokkumar Balasubramanian Syncfusion Team June 22, 2016 03:01 PM UTC

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


TG Tyeth Gundry November 17, 2016 07:55 PM UTC

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.


TG Tyeth Gundry replied to Tyeth Gundry November 17, 2016 08:10 PM UTC

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...


GS Gobalakrishnan S Syncfusion Team November 18, 2016 01:16 PM UTC

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 



TG Tyeth Gundry November 18, 2016 02:42 PM UTC

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


AB Ashokkumar Balasubramanian Syncfusion Team November 21, 2016 12:20 PM UTC

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. 


Loader.
Up arrow icon