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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Inline Editor does not format intial value correctly when a custom format exists

Thread ID:

Created:

Updated:

Platform:

Replies:

143470 Mar 21,2019 09:29 AM UTC Mar 25,2019 08:31 AM UTC JavaScript - EJ 2 3
loading
Tags: InPlaceEditor
Craig
Asked On March 21, 2019 09:29 AM UTC

Hi,

I am having problems with the InLine Editor formatting the initial value of a custom formatted numeric text box. See code below where I have tested it against the standard NumericTextBox.

              //Numeric Text Box
                        var numeric = new ej.inputs.NumericTextBox({
                            // sets the format using custom format string `#`
                            format: 'PREFIX ###.##',
                            value: 10.56,
                            placeholder: 'Custom format string #',
                            floatLabelType: 'Auto'

                        });

                        numeric.appendTo('#numeric');

                        //Inline Edtior
                        var numeric1 = new ej.inplaceeditor.InPlaceEditor({
                            mode: 'Inline',
                            type: 'Numeric',
                            model: {
                                format: 'PREFIX ###.##',
                                placeholder: 'Purchase Order Total',
                                value: 10.56,
                                floatLabelType: 'Auto'
                            },
                            value: 10.56,
        
                        });

                        numeric1.appendTo('#inline');


see: http://www.youtube.com/watch?v=CQ0C1veGtuo

As you can see if I try and set a non numeric value to the inline editor the value gets lost on edit.

Criag


Prince Oliver [Syncfusion]
Replied On March 25, 2019 04:03 AM UTC

Hello Craig, 

Greetings from Syncfusion support. 

We have analyzed your sample code and were able to replicate the reported scenario. If we set both value and model value property in an In-place Editor component, model value property will be overridden by editor value property. This is because it has high priority and model property is used to customize the properties of integrated EJ2 controls. EJ2 NumericTextBox accepts value as `number` type, so you must specify number type only. 

To achieve your requirement, remove the In-place Editor’s value property and use emptyText property for displaying initial value in the editor. The emptyText property value will be applied, when the editor value property has null value and it is used like placeholder. 


Let us know if you have any concern. 

Regards, 
Prince 


Craig
Replied On March 25, 2019 07:10 AM UTC

Hi,

I can confirm that this resolves my problem.

Thanks

Craig


Prince Oliver [Syncfusion]
Replied On March 25, 2019 08:31 AM UTC

Hello Craig, 

Thank you for the update. We are glad that the issue is resolved in your end. 

Regards, 
Prince 


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

Live Chat Icon For mobile
Live Chat Icon