Assertion error

Posted by: kevin.krohn on 18 May 2018, 4:46 am EST

    • Post Options:
    • Link

    Posted 18 May 2018, 4:46 am EST

    Can anyone tell me how to figure out where the issue is when I get this error in my Angular 2 app?

    ERROR ** Assertion failed in Wijmo: function t(n){var r=e.call(this)||this;return r._f=g.ColumnDefault,r._hash=t._ctr.toString(36),t._ctr++,n&&o.copy(r,n),r} expected.

    I have no idea what component is causing the issue.

    Thanks

  • Posted 20 May 2018, 7:20 pm EST

    Hi Kevin,

    The issue seems due to FlexGrid component. On being more specific, it is because of FlexGridColumn.

    If you can share the sample code, the error cause may be explain more specifically.

    ~Manish

  • Posted 1 June 2018, 1:37 am EST

    I have two pages that I display through child routing. One page grid definitions are:

    <wj-flex-grid #grid id=“laborGrid” style=“height:420px;” (mouseup)=“hideShowGridMenu($event, grid)” [itemsSource]=“data”

    [selectionMode]=“5” [autoGenerateColumns]=“false” (dblclick)=“frmUpdate.show(data.currentItem)” (initialized)=“addFooterRow(grid)”>

    <wj-flex-grid-filter #filter>

    <wj-flex-grid-column [header]=“‘Code’” [binding]=“‘displayCode’” [isReadOnly]=“true”>

    <wj-flex-grid-column [header]=“‘Description’” [binding]=“‘description’” [width]=“300” [isReadOnly]=“true”>

    <wj-flex-grid-column [header]=“‘Est Hrs’” [binding]=“‘estHrs’” [format]=“‘n2’” [isRequired]=“false” [aggregate]=“‘Sum’”>

    <wj-flex-grid-column [header]=“‘Actual Hrs’” [binding]=“‘actualHrs’” [format]=“‘n2’” [isRequired]=“false” [aggregate]=“‘Sum’”

    [visible]=“globals.isInRoles([‘Admin’,‘View Cost Info’])” [isReadOnly]=“true”>

    <wj-flex-grid-column [header]=“‘Hrs Rem’” [binding]=“‘hrsRem’” [format]=“‘n2’” [isRequired]=“false” [aggregate]=“‘Sum’” [isReadOnly]=“true” [visible]=“globals.isInRoles([‘Admin’,‘View Cost Info’])”>

    <wj-flex-grid-column [header]=“‘Est Hrs Rem’” [binding]=“‘estHrsRem’” [format]=“‘n2’” [isRequired]=“false” [aggregate]=“‘Sum’” [isReadOnly]=“true”

    [visible]=“globals.isInRoles([‘Admin’,‘View Cost Info’])” [width]=“125”>

    <wj-flex-grid-column [header]=“‘Quoted Hrs’” [binding]=“‘quotedHrs’” [format]=“‘n2’” [isRequired]=“false” [aggregate]=“‘Sum’”

    [visible]=“globals.isInRoles([‘Admin’,‘View Quoted Info’])”>

    <wj-flex-grid-column [header]=“‘Rate’” [binding]=“‘rate’” [format]=“‘c2’” [isRequired]=“false” [visible]=“globals.isInRoles([‘Admin’,‘View Cost Info’])”>

    <wj-flex-grid-column [header]=“‘Est Total’” [binding]=“‘estTotal’” [format]=“‘c2’” [isRequired]=“false” [aggregate]=“‘Sum’” [isReadOnly]=“true”

    [visible]=“globals.isInRoles([‘Admin’,‘View Cost Info’])”>

    <wj-flex-grid-column [header]=“‘Quoted Total’” [binding]=“‘quotedTotal’” [format]=“‘c2’” [isRequired]=“false” [aggregate]=“‘Sum’” [isReadOnly]=“true”

    [visible]=“globals.isInRoles([‘Admin’,‘View Quoted Info’])” [width]=“120”>

    <wj-flex-grid-column [header]=“‘Actual Total’” [binding]=“‘actualTotal’” [format]=“‘c2’” [isRequired]=“false” [aggregate]=“‘Sum’” [isReadOnly]=“true” [width]=“130”>



    <wj-flex-grid #grid2 id=“laborGrid2” (mouseup)=“hideShowGridMenu($event, grid2)” [itemsSource]=“data2”

    [selectionMode]=“5” [autoGenerateColumns]=“false” (dblclick)=“frmUpdate.show(data2.currentItem)” [headersVisibility]=“2”>

    <wj-flex-grid-column [header]=“‘Code’” [binding]=“‘displayCode’” [isReadOnly]=“true”>

    <wj-flex-grid-column [header]=“‘Description’” [binding]=“‘description’” [width]=“300” [isReadOnly]=“true”>

    <wj-flex-grid-column [header]=“‘Est Hrs’” [binding]=“‘estHrs’” [format]=“‘n2’” [isRequired]=“false” [aggregate]=“‘Sum’”>

    <wj-flex-grid-column [header]=“‘Actual Hrs’” [binding]=“‘actualHrs’” [format]=“‘n2’” [isRequired]=“false” [aggregate]=“‘Sum’”

    [visible]=“globals.isInRoles([‘Admin’,‘View Cost Info’])” [isReadOnly]=“true”>

    <wj-flex-grid-column [header]=“‘Hrs Rem’” [binding]=“‘hrsRem’” [format]=“‘n2’” [isRequired]=“false” [aggregate]=“‘Sum’” [isReadOnly]=“true” [visible]=“globals.isInRoles([‘Admin’,‘View Cost Info’])”>

    <wj-flex-grid-column [header]=“‘Est Hrs Rem’” [binding]=“‘estHrsRem’” [format]=“‘n2’” [isRequired]=“false” [aggregate]=“‘Sum’” [isReadOnly]=“true”

    [visible]=“globals.isInRoles([‘Admin’,‘View Cost Info’])” [width]=“125”>

    <wj-flex-grid-column [header]=“‘Quoted Hrs’” [binding]=“‘quotedHrs’” [format]=“‘n2’” [isRequired]=“false” [aggregate]=“‘Sum’”

    [visible]=“globals.isInRoles([‘Admin’,‘View Quoted Info’])”>

    <wj-flex-grid-column [header]=“‘Rate’” [binding]=“‘rate’” [format]=“‘c2’” [isRequired]=“false” [visible]=“globals.isInRoles([‘Admin’,‘View Cost Info’])”>

    <wj-flex-grid-column [header]=“‘Est Total’” [binding]=“‘estTotal’” [format]=“‘c2’” [isRequired]=“false” [aggregate]=“‘Sum’” [isReadOnly]=“true”

    [visible]=“globals.isInRoles([‘Admin’,‘View Cost Info’])”>

    <wj-flex-grid-column [header]=“‘Quoted Total’” [binding]=“‘quotedTotal’” [format]=“‘c2’” [isRequired]=“false” [aggregate]=“‘Sum’” [isReadOnly]=“true”

    [visible]=“globals.isInRoles([‘Admin’,‘View Quoted Info’])” [width]=“120”>

    <wj-flex-grid-column [header]=“‘Actual Total’” [binding]=“‘actualTotal’” [format]=“‘c2’” [isRequired]=“false” [aggregate]=“‘Sum’” [isReadOnly]=“true” [width]=“130”>

    and the other page is:

    <wj-flex-grid #grid id=“materialGrid” style=“height:480px;” (mouseup)=“hideShowGridMenu($event, null)” [itemsSource]=“data”

    [selectionMode]=“5” [isReadOnly]=“true” [autoGenerateColumns]=“false” (dblclick)=“frmUpdate.show(currentJobNumber, data.currentItem.id, 0, data.currentItem.section)”

    (initialized)=“addFooterRow(grid)” [allowDragging]=“‘Columns’”>

    <ng-template wjFlexGridCellTemplate [cellType]=“‘TopLeft’” let-cell=“cell”>

    <span [class]=“getGroupClass” (click)=“groupexpandCollapse()”>



    <wj-flex-grid-filter #filter>

    <wj-flex-grid-column [header]=“‘Item’” [binding]=“‘position’”>

    <wj-flex-grid-column [header]=“‘Vendor’” [binding]=“‘vendorCode’” [width]=“100”>

    <wj-flex-grid-column [header]=“‘Qty’” [binding]=“‘qty’” [width]=“50”>

    <wj-flex-grid-column [header]=“‘MFG Code’” [binding]=“‘mfgCode’” [width]=“100”>

    <wj-flex-grid-column [header]=“‘Part Number’” [binding]=“‘partNumber’” [width]=“155”>

    <wj-flex-grid-column [header]=“‘Description’” [binding]=“‘shortDescription’” [width]=“300”>

    <wj-flex-grid-column [header]=“‘Long Description’” [binding]=“‘longDescription’” [width]=“300” [visible]=“false”>

    <wj-flex-grid-column [header]=“‘List Price’” [binding]=“‘listPrice’” [format]=“‘c4’” [isRequired]=“false”>

    <wj-flex-grid-column [header]=“‘Mult Code’” [binding]=“‘multCode’”>

    <wj-flex-grid-column [header]=“‘Mult Value’” [binding]=“‘multValue’” [format]=“‘n5’” [isRequired]=“false”>

    <wj-flex-grid-column [header]=“‘Unit Cost’” [binding]=“‘netCost’” [format]=“‘c4’” [isRequired]=“false”>

    <wj-flex-grid-column [header]=“‘Ext Cost’” [binding]=“‘extCost’” [format]=“‘c2’” [aggregate]=“‘Sum’” [isRequired]=“false”>

    <wj-flex-grid-column [header]=“‘Rev Date’” [binding]=“‘priceRevDate’” [dataType]=“‘Date’” [format]=“‘MM/dd/yyyy’” [isRequired]=“false”>

    <wj-flex-grid-column [header]=“‘Notes’” [binding]=“‘notes’”>

    <wj-flex-grid-column [header]=“‘Cert’” [binding]=“‘cert’”>

    <wj-flex-grid-column [header]=“‘Updated By’” [binding]=“‘lastUpdatedBy’” [isReadOnly]=“true” [width]=“135”>

    <wj-flex-grid-column [header]=“‘Updated Date’” [binding]=“‘lastUpdatedDate’” [dataType]=“‘Date’” [format]=“‘MM/dd/yyyy’”

    [isRequired]=“false” [isReadOnly]=“true” [width]=“135”>

    <wj-flex-grid-column [header]=“‘Ordered By’” [binding]=“‘orderedBy’” [isReadOnly]=“true” [width]=“135”>

    <wj-flex-grid-column [header]=“‘Ordered Date’” [binding]=“‘orderDate’” [dataType]=“‘Date’” [format]=“‘MM/dd/yyyy’” [isRequired]=“false”

    [isReadOnly]=“true” [width]=“135”>

    <wj-flex-grid-column [header]=“‘Confirmed By’” [binding]=“‘confirmedBy’” [isReadOnly]=“true” [width]=“135”>

    <wj-flex-grid-column [header]=“‘Confirmed Date’” [binding]=“‘confirmedDate’” [dataType]=“‘Date’” [format]=“‘MM/dd/yyyy’”

    [isRequired]=“false” [isReadOnly]=“true” [width]=“135”>

  • Posted 3 June 2018, 10:31 pm EST

    Hi,

    The code snippets seems fine except following:

    [visible]="globals.isInRoles(['Admin','View Cost Info'])"
    

    Please be sure above method should return boolean value.

    Please share a demo sample in case the issue persists.

    ~Manish

  • Posted 15 June 2018, 7:08 am EST

    That code did return a boolean value. I have tried a lot of things like removing the columns and I still get an error. Not sure I can slim down the code for a sample. The error doesn’t seem to affect anything. I just don’t like getting it.

  • Posted 18 June 2018, 12:29 am EST

    Hi,

    We are unable to replicate the issue at our end.

    Here is the sample that we tried:-https://stackblitz.com/edit/angular-quz7dh?file=app%2Fapp.component.html

    Please have a look at it and let us know if we are missing something important to replicate the problem or you can also edit the sample so that we can investigate any further.

    ~Manish

  • Posted 14 May 2020, 12:52 am EST

    Hi, I am adding wj-input- number in grid but i am getting error whenevr i click on input field.

    “Assertion failed error: number required”

    <ng-template wjFlexGridCellTemplate [cellType]=“‘CellEdit’” let-cell=“cell”>

    <wj-input-number

    id=“{{column.key}}{{i}}”

    [(value)]=“cell.value”

    [min]=“0”

    [format]=“c”>



    input module is also imported

  • Posted 14 May 2020, 3:53 pm EST

    Hi Megha,

    This error will only occur if the current column, on which you have added the cell template, is of type string. Please make sure that whether the column contains numerical values. Sometimes, the values in the column are numeric but they are stored as string. This may also cause the same issue.

    If the values are numerical, can you please provide a sample replicating the issue so that we can investigate further?

    Regards,

    Ashwin

  • Posted 15 May 2020, 6:23 am EST

    Thanks Ashwin.It solved my problem

Need extra support?

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

Learn More

Forum Channels