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);
}