cssangular5jqwidget

Jqwidgets percentagewise width not working with Angular-5


I have worked with jqwidgets in jquery and width : '100%' works fine in jqxGrid. But in jqwidgets with Angular-5 components they are showing errors,

Unexpected end of expression: 100% at the end of the expression [100%] in ng:///DashboardModule/DashboardComponent.html@126:14 ("            </jqxGrid> -->
            <jqxGrid #myGrid (onFilter)="myGridOnFilter()"

My dashboard.component.html file,

<jqxGrid #myGrid (onFilter)="myGridOnFilter()"
              [width]="100%" [source]="dataAdapter" [columns]="columns"
              [sortable]="true" [filterable]="true"  [pageable]="true" 
              [enabletooltips]="true" [columnsresize]="true" [columnsreorder]="true" 
              [autoshowfiltericon]="true" [columnmenuopening]="columnmenuopening">
</jqxGrid>

Width with pixel works fine here. If I put [width]="700" it works fine but for % it's not working. I have tried with [width]='100%' and even with [width]=100%.

here is the property file of Angular components of Jqwidgets. Link :- https://www.jqwidgets.com/angular-components-documentation/documentation/jqxgrid/angular-grid-api.htm?search=width


Solution

  • It is String, and as such should be "'100%'"