Skip to content

Commit

Permalink
Merge pull request #4330 from IgniteUI/update-editCell-snippets-71xx
Browse files Browse the repository at this point in the history
fix(docs): Cell and row editing docs update #4055
  • Loading branch information
zdrawku authored Mar 18, 2019
2 parents 3036bdb + 3f99b35 commit f6f55f1
Showing 1 changed file with 79 additions and 26 deletions.
105 changes: 79 additions & 26 deletions projects/igniteui-angular/src/lib/grids/grid-base.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -931,10 +931,21 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements

/**
* An @Output property emitting an event when `IgxGridCellComponent`
* editing has been performed in the grid and the values have **not** been submitted.
* On `IgxGridCellComponent` editing, both `IgxGridCellComponent` and `IgxGridRowComponent`
* objects in the event arguments are defined for the corresponding
* `IgxGridCellComponent` that is being edited and the `IgxGridRowComponent` the `IgxGridCellComponent` belongs to.
* editing has been performed in the grid and the values have **not** been submitted (e.g. `Esc` key was pressed).
* This event is cancelable.
*
* args: IGridEditEventArgs = {
* cancel: bool,
* cellID: {
* columnID: int,
* rowID: int,
* rowIndex: int
* }
* newValue: object,
* oldValue: object,
* rowID: int
* }
*
* ```typescript
* editCancel(event: IGridEditEventArgs){
* const rowID: IgxColumnComponent = event.rowID;
Expand All @@ -955,9 +966,19 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements

/**
* An @Output property emitting an event when `IgxGridCellComponent` enters edit mode.
* On `IgxGridCellComponent` editing, both `IgxGridCellComponent` and `IgxGridRowComponent`
* objects in the event arguments are defined for the corresponding
* `IgxGridCellComponent` that is being edited and the `IgxGridRowComponent` the `IgxGridCellComponent` belongs to.
* This event is cancelable.
*
* args: IGridEditEventArgs = {
* cancel: bool,
* cellID: {
* columnID: int,
* rowID: int,
* rowIndex: int
* }
* oldValue: object,
* rowID: int
* }
*
* ```typescript
* editStart(event: IGridEditEventArgs){
* const value: IgxColumnComponent = event.newValue;
Expand All @@ -978,9 +999,21 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements

/**
* An @Output property emitting an event when `IgxGridCellComponent` editing has been performed in the grid.
* On `IgxGridCellComponent` editing, both `IgxGridCellComponent` and `IgxGridRowComponent`
* objects in the event arguments are defined for the corresponding
* `IgxGridCellComponent` that is being edited and the `IgxGridRowComponent` the `IgxGridCellComponent` belongs to.
* Event is fired after editing is completed, when the cell is exiting edit mode.
* This event is cancelable.
*
* args: IGridEditEventArgs = {
* cancel: bool,
* cellID: {
* columnID: int,
* rowID: int,
* rowIndex: int
* }
* newValue: object,
* oldValue: object,
* rowID: int
* }
*
* ```typescript
* editDone(event: IGridEditEventArgs){
* const value: IgxColumnComponent = event.newValue;
Expand All @@ -1001,8 +1034,13 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements

/**
* An @Output property emitting an event when [rowEditable]="true" a row enters edit mode.
* This event is cancelable.
*
* Emits the current row and it's state.
* args: IGridEditEventArgs = {
* cancel: bool,
* oldValue: <rowObj>,
* rowID: int
* }
*
* Bind to the event in markup as follows:
* ```html
Expand All @@ -1014,10 +1052,10 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
* </igx-grid>
* ```
* ```typescript
* editStart(emitted: { row: IgxGridRowComponent, newValue: any, oldValue: any }): void {
* const editedRow = emitted.row;
* const cancelValue = emitted.newValue;
* const oldValue = emitted.oldValue;
* editStart(event: IGridEditEventArgs) {
* const editedRowObj = event.oldValue;
* const cancelValue = event.cancel;
* const rowID = event.rowID;
* }
* ```
* @memberof IgxGridComponent
Expand All @@ -1028,10 +1066,16 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
/**
* An @Output property emitting an event when [rowEditable]="true" & `endEdit(true)` is called.
* Emitted when changing rows during edit mode, selecting an un-editable cell in the edited row,
* performing data operations (filtering, sorting, etc.) while editing a row, hitting the `Commit`
* button inside of the rowEditingOverlay or hitting the `Enter` key while editing a cell.
* performing paging operation, column resizing, pinning, moving or hitting `Done`
* button inside of the rowEditingOverlay, or hitting the `Enter` key while editing a cell.
* This event is cancelable.
*
* Emits the current row and it's state.
* args: IGridEditEventArgs = {
* cancel: bool,
* newValue: <rowObj>,
* oldValue: <rowObj>,
* rowID: int
* }
*
* Bind to the event in markup as follows:
* ```html
Expand All @@ -1042,11 +1086,13 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
* <igx-column [sortable]="true" [field]="'UnitsInStock'" [header]="'Units in Stock'"></igx-column>
* </igx-grid>
* ```
*
* ```typescript
* editDone(emitted: { row: IgxGridRowComponent, newValue: any, oldValue: any }): void {
* const editedRow = emitted.row;
* const newValue = emitted.newValue;
* const oldValue = emitted.oldValue;
* editDone(event: IGridEditEventArgs) {
* const originalRowObj = event.oldValue;
* const updatedRowObj = event.newValue;
* const cancelValue = event.cancel;
* const rowID = event.rowID;
* }
* ```
* @memberof IgxGridBaseComponent
Expand All @@ -1058,8 +1104,14 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
* An @Output property emitting an event when [rowEditable]="true" & `endEdit(false)` is called.
* Emitted when changing hitting `Esc` key during cell editing and when click on the `Cancel` button
* in the row editing overlay.
* This event is cancelable.
*
* Emits the current row and it's state.
* args: IGridEditEventArgs = {
* cancel: bool,
* newValue: <rowObj>,
* oldValue: <rowObj>,
* rowID: int
* }
*
* Bind to the event in markup as follows:
* ```html
Expand All @@ -1072,9 +1124,10 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
* ```
* ```typescript
* editCancel(emitted: { row: IgxGridRowComponent, newValue: any, oldValue: any }): void {
* const editedRow = emitted.row;
* const cancelValue = emitted.newValue;
* const oldValue = emitted.oldValue;
* const originalRowObj = event.oldValue;
* const updatedRowObj = event.newValue;
* const cancelValue = event.cancel;
* const rowID = event.rowID;
* }
* ```
* @memberof IgxGridBaseComponent
Expand Down

0 comments on commit f6f55f1

Please sign in to comment.