Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group header with columns which width is defined as number throws an exception #3020

Closed
npaunov opened this issue Nov 14, 2018 · 0 comments · Fixed by #3080
Closed

Group header with columns which width is defined as number throws an exception #3020

npaunov opened this issue Nov 14, 2018 · 0 comments · Fixed by #3080
Assignees
Labels
🐛 bug Any issue that describes a bug 🧨 severity: medium grid: general grid: multi-column-headers version: 6.2.x ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.

Comments

@npaunov
Copy link
Contributor

npaunov commented Nov 14, 2018

Description

Group Header causes an error when the columns' width is a number

  • igniteui-angular version: 6.2.x
  • browser: all

Steps to reproduce

  1. Go to the dev demos Grid Cell Styling
  2. Add group header e.g.:
<igx-column-group header="Group Header 1">
<igx-column *ngFor="let c of columns" [field]="c.field" [header]="c.field" [width]="c.width"
                    [movable]="true" [groupable]="true"
                    [resizable]="true" [sortable]="true"   [filterable]="true"
                    [editable]="true" [cellClasses]="c.cellClasses">
   </igx-column>
 </igx-column-group>
  1. Run the sample

Result

The columns are not shown and there is an error in the console:
"ERROR TypeError: val.width.indexOf is not a function"

Expected result

The columns are shown with multi column header and there is no error.

Note:

In projects\igniteui-angular\src\lib\grids\column.component.ts
image

the check expects a string although the columns widths in the sample are defined as numbers. Perhaps a cast to string can be added before the '%' check

@bkulov bkulov assigned bkulov and unassigned SAndreeva Nov 20, 2018
@bkulov bkulov changed the title Multi Column Header causes an error when the columns are auto generated and the width is a number Group header with columns which width is defined as number throws an exception Nov 20, 2018
@bkulov bkulov added 🛠️ status: in-development Issues and PRs with active development on them ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. and removed 🛠️ status: in-development Issues and PRs with active development on them labels Nov 21, 2018
bkulov pushed a commit that referenced this issue Nov 21, 2018
kdinev pushed a commit that referenced this issue Nov 21, 2018
* fix(grid): Fix exception when col width in numbers (#3020)

* Update column-group.spec.ts

* fix(grid): Better check for input parameter type (#3020)

* fix(grid): Remove redundant check (#3020)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Any issue that describes a bug 🧨 severity: medium grid: general grid: multi-column-headers version: 6.2.x ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants