igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

Grid: onCellSelection EventEmitter doesn't fire

Open QuinntyneBrown opened this issue 8 years ago • 3 comments

View Issue Here (Stackblitz): https://stackblitz.com/edit/angular-itxkwr

I have added (onCellSelection)="onSelect($event)" to my markup on my grid.

<igx-grid #grid1 [data]="tags" (onCellSelection)="onSelect($event)"> <igx-column [sortable]="fasle" [field]="'name'" [header]="'Name'">

My callback doesn't execute when I select the cell.

The documentation says I need to import some class to make things work, but it fails to be specify as to where I should import these classes from relative to " ...} from 'igniteui-angular/...etc" and it doesn't mention what needs to be included in the Angular module or component. Are these class providers the component needs?

Documention:

import { IgxGridBindingBehavior, IgxGridColumnInitEvent, IgxGridComponent } from "../../../src/grid/grid.component"; import { DataContainer, IDataState, IgxSnackbar, IgxToast, IPagingState, PagingError, SortingDirection, StableSortingStrategy } from "../../../src/main";

I'm using the igniteui-angular module pulled in from npm, so the above documentation is not helpful. I don't have "../../../src/main" in my project. Does this mean I should reference "igniteui-angular/main"?

It would nice if you had an angular-cli demo project implementing the grid. That would clear up everything.

QuinntyneBrown avatar Mar 15 '18 19:03 QuinntyneBrown

@QuinntyneBrown I suppose you've consulted the Grid readme doc which unfortunately is out of date with the current API of the grid component. #777 You may want to check this for up to date documentation and here is your updated sample with the current onSelection event.

rkaraivanov avatar Mar 16 '18 10:03 rkaraivanov

Thanks, that works! I have another question, but I will open up another issue for that.

QuinntyneBrown avatar Mar 16 '18 13:03 QuinntyneBrown

@QuinntyneBrown closing this one as I see your question was answered reopen and comment if needed :)

SlavUI avatar Mar 19 '18 13:03 SlavUI