This topic contains 2 replies, has 2 voices, and was last updated by Hristo 8 years, 1 month ago.
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.
jQuery UI Widgets › Forums › Editors › NumberInput › Bug: refresh() does not respect null values
Tagged: angular numberInput, bootstrap numberinput, javascript numberinput, jquery numberInput, jqwidgets numberinput, jqxnumberinput, null value render numberinput
This topic contains 2 replies, has 2 voices, and was last updated by Hristo 8 years, 1 month ago.
I was having a strange issue while playing with your numeric component and angular2, and I think I came up with a bug affecting, not the angular2 implementation, but the jqxnumberinput itself (in “simple” mode).
The thing is, you have this bit here:
a.jqx.utilities.resize(this.host, function() {
f._render()
})
which is causing a refresh to happen in my angular code and a call to this._parseDecimalInSimpleMode();
. This also happens if you call the public method refresh().
Now, in the implementation of that method you have var e = this.ValueString;
which never returns an empty string when I have set a “null” value in the component (as you do in other parts of the code). Instead, it resets the component to 0.00.
The way to reproduce this myself in angular2 is, in a template like:
<angularNumberInput [(ngModel)]="value" #numericInput>
</angularNumberInput>
And this in the component:
value : any = null;
numericInputSettings: jqwidgets.NumberInputOptions = { width: '250px', height: '25px', spinButtons: false, spinButtonsStep: "0", inputMode: "simple", allowNull: true, placeHolder: "Null Value"};
ngAfterViewInit(): void
{
this.numericInput.createWidget(this.numericInputSettings);
var self = this;
setTimeout(function(){ self.numericInput.widgetObject.refresh(); }, 3000);
}
I have fixed the problem by adding:
this.ValueString = "";
in line 2853, on the _setDecimal
function. Although it does not respect the symbol
Hello lqbweb,
Thank you for this feedback.
We appreciate your help and will investigate this.
Best Regards,
Hristo Hristov
jQWidgets team
http://www.jqwidgets.com
You must be logged in to reply to this topic.