Wj-input-number has set [isRequired]="false" but got Assertion failed error

Posted by: kun.leeing on 27 May 2020, 4:09 pm EST

  • Posted 27 May 2020, 4:09 pm EST

    Hi Team,

    I am using wj-input-number as below

    <ng-template wjFlexGridCellTemplate [cellType]=“‘Cell’” let-item=“item”>

    <wj-input-number [(value)]=“value” [isRequired]=“false”>

    But I still got “ERROR Error: ** Assertion failed in Wijmo: Number expected. Error”

    I have checked the binding object, the value is null. How can I make number input compatible with null?

    Cheers,

    Kun

  • Posted 28 May 2020, 4:27 pm EST

    Hi Kun,

    Can you please let us know whether you are using Angular Ivy? In ivy, the initialization order is important. So, if you are using ivy, then first set the isRequired to false and then bind the value:

    <wj-input-number [isRequired]="false" [(value)]="value"></wj-input-number>
    

    Regards,

    Ashwin

  • Posted 28 May 2020, 7:08 pm EST

    Thanks, Ashwin. After changing the order, it works now.

    But there is still a problem which is the alignment of the placeholder, looks like wj-input-number and wj-input-mask has different alignment of the placeholder text?

  • Posted 31 May 2020, 3:41 pm EST

    Hi Kun,

    In Wijmo, all of the numerical controls and columns are right-aligned and all the text controls and columns are left-aligned.

    If you need to left-align the InputNumber, then you may use the following CSS:

    .wj-inputnumber .wj-form-control {
    	text-align: left !important;
    }
    

    ~regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels