Initialize and Access a Numeric Textbox
- If a number is typed into the textbox, then the datatype if "string".
- If one of the up/down buttons is clicked, then the datatype is "number", if the data is accessed from within "valueChange". And it is "string", if the data is accessed from outside.
Hi Michael,
Thank you for using Syncfusion products.
Query 1 : Now suppose I want to create a numeric textbox which initially has no value.
Since NumericTextbox “value” supports only number type. To set no value initially, do the below step.
$('#numeric').ejNumericTextbox({ value: NaN });
Also, if we want to set the empty string, undefined and null value to numeric textbox, please convert that to number object like.
$('#numeric').ejNumericTextbox({value: parseInt("")});
$('#numeric').ejNumericTextbox({value: parseInt(undefined)});
$('#numeric').ejNumericTextbox({value: parseInt(null)});
However while processing the above value with setModel , we have faced the issue empty string didn’t get updated. So we included this issue with query 2,3 issue report.
Query 2 : I access the value with $("#test").ejNumericTextbox("option", "value") Suppose the user deletes the value of the numeric textbox (select the content, hit DEL). Then the above returns "1". Why?
Query 3 : The returned datatype depends on how the value was entered into the numeric textbox.
Sorry for this inconvenience, We are able to reproduce the issue reported in query 2 and 3 and we have logged an Issue report on this. We will update you with the fix for this issue in upcoming release.
Query 4: I am not able to enter a 1000-separator into the textbox. Is this intended?
Yes, we restrict the separator to be entered into textbox. Since Numeric textbox itself sets the separator on focus out.
Regards
Saravanan G
- Regarding "value: NaN". If I set the value that way, then access the value via ejNumericTextbox("option", "value"), no valid string/integer will be returned. Instead a jQuery object will be returned.
- It is important that empty values are handled correctly with Essential JS. When creating a business application, a NULL that is stored inside a SQL database will make its way into a null in some Javascript object, which will finally be put into one of your widgets. Also when saving the values to the SQL database a NULL should be handled, without forcing the developer to do much work. So ideally, I appreciated if a Javascript null could be put into a widget's value.
- No big deal, just a remark. Some people prefer to type the 1000-separator. So maybe you should also allow it. After all, I can paste a 1000-separator into your widget. Then you do accept it.
Hi Michael,
Thanks for your update ,
Query #1: Regarding "value: NaN".
Query #2: Empty values are handled correctly with Essential JS.
Sorry for the inconvenience, We have confirmed the defect of numeric textbox “value” data type as number, so we will change this data type to support both string as well as number. This fix will resolve the entire problem with numeric textbox and this changes will be reflected in our upcoming main release.
Query #3: Not able to enter a 1000-separator into the textbox?
We will analyses on this requirement and update you the status on 30 Aug 2013 . So please be patience until we will get back to you.
Regards
Saravanan G
Hi Michael,
We are sorry for inconvenience caused.
In beta release, we have not null value support for Datepicker control, we will implement this feature and it will be available in our upcoming main release. We will let you know once the release rolled out.
Regards
Saravanan G
Hi Schneider,
We deeply regret for the inconvenience caused.
Currently We have not null value support for textbox controls(editors, autocomplete, datepicker, ..), and we need to ensure the remaining controls with null value. we will ensure these features in remaining controls and update you in 3 business days(3/Sep/2013), so we request you to please be patience until then.
Please let me know if you have any concerns.
Regards,
Saravanan G
Hi Michael,
Thank you for your update.
Textbox controls will accepts string and numbers data type. In this case our textboxes supports Null, undefined, empty string and NaN values, and stores the value as empty string in model. We will follow the same procedure for all other widgets based on behaviour type.
Please let us know if you have any further queries.
Regards,
Saravanan G
Hi Michael,
Thank you for your update.
We will let you know once the release has been rolled out.
Regards,
Saravanan G
- 13 Replies
- 2 Participants
-
MG Michael G. Schneider
- Aug 24, 2013 08:10 AM UTC
- Sep 11, 2013 11:16 AM UTC