@progress/kendo-angular-listview 19.1.2-develop.2 → 19.1.2-develop.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data-binding/data-binding.directive.d.ts +19 -2
- package/editing/commands/add-command.directive.d.ts +5 -4
- package/editing/commands/cancel-command.directive.d.ts +6 -5
- package/editing/commands/edit-command.directive.d.ts +5 -5
- package/editing/commands/remove-command.directive.d.ts +6 -5
- package/editing/commands/save-command.directive.d.ts +6 -5
- package/editing/edit-template.directive.d.ts +23 -5
- package/editing/events/add-event-args.interface.d.ts +2 -1
- package/editing/events/cancel-event-args.interface.d.ts +2 -1
- package/editing/events/edit-event-args.interface.d.ts +6 -5
- package/editing/events/remove-event-args.interface.d.ts +2 -1
- package/editing/events/save-event-args.interface.d.ts +3 -2
- package/esm2022/data-binding/data-binding.directive.mjs +19 -2
- package/esm2022/editing/commands/add-command.directive.mjs +5 -4
- package/esm2022/editing/commands/cancel-command.directive.mjs +6 -5
- package/esm2022/editing/commands/edit-command.directive.mjs +5 -5
- package/esm2022/editing/commands/remove-command.directive.mjs +6 -5
- package/esm2022/editing/commands/save-command.directive.mjs +6 -5
- package/esm2022/editing/edit-template.directive.mjs +23 -5
- package/esm2022/listview.component.mjs +74 -41
- package/esm2022/models/page-size-change-event.mjs +2 -2
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/templates/footer-template.directive.mjs +18 -2
- package/esm2022/templates/header-template.directive.mjs +19 -2
- package/esm2022/templates/item-template.directive.mjs +23 -6
- package/esm2022/templates/loader-template.directive.mjs +18 -1
- package/fesm2022/progress-kendo-angular-listview.mjs +226 -87
- package/listview.component.d.ts +74 -41
- package/models/listview-data-result.d.ts +3 -3
- package/models/page-change-event.d.ts +3 -2
- package/models/page-size-change-event.d.ts +2 -2
- package/models/page-size-item.d.ts +2 -2
- package/models/pager-position.d.ts +4 -2
- package/models/pager-settings.d.ts +4 -9
- package/models/pager-type.d.ts +2 -5
- package/models/scroll-bottom-event.d.ts +2 -2
- package/package.json +8 -8
- package/schematics/ngAdd/index.js +6 -6
- package/templates/footer-template.directive.d.ts +18 -2
- package/templates/header-template.directive.d.ts +19 -2
- package/templates/item-template.directive.d.ts +23 -6
- package/templates/loader-template.directive.d.ts +18 -1
|
@@ -5,13 +5,30 @@
|
|
|
5
5
|
import { ListViewComponent } from '../listview.component';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Encapsulates the in-memory handling of paging for the ListView component
|
|
9
9
|
* ([see example]({% slug paging_listview %}#toc-binding-directive)).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* @Component({
|
|
14
|
+
* selector: 'my-app',
|
|
15
|
+
* template: `
|
|
16
|
+
* <kendo-listview [kendoListViewBinding]="listItems">
|
|
17
|
+
* <ng-template kendoListViewItemTemplate let-dataItem>
|
|
18
|
+
* <div>{{ dataItem.name }}</div>
|
|
19
|
+
* </ng-template>
|
|
20
|
+
* </kendo-listview>
|
|
21
|
+
* `
|
|
22
|
+
* })
|
|
23
|
+
* export class AppComponent {
|
|
24
|
+
* listItems = [{ name: 'Item 1' }, { name: 'Item 2' }];
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
10
27
|
*/
|
|
11
28
|
export declare class DataBindingDirective {
|
|
12
29
|
private listView;
|
|
13
30
|
/**
|
|
14
|
-
*
|
|
31
|
+
* Specifies the array of data that populates the ListView.
|
|
15
32
|
*/
|
|
16
33
|
set data(data: any[]);
|
|
17
34
|
get data(): any[];
|
|
@@ -8,14 +8,15 @@ import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
|
8
8
|
import { EditService } from '../edit.service';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
/**
|
|
11
|
-
* Represents the command
|
|
11
|
+
* Represents the add command button directive of the Kendo UI ListView for Angular.
|
|
12
|
+
* Provides the command for adding a new item to the ListView. You can apply this directive to any
|
|
12
13
|
* `button` element inside a [`HeaderTemplate`]({% slug api_listview_headertemplatedirective %}).
|
|
13
|
-
* When an associated button with the directive
|
|
14
|
-
* [`add`]({% slug api_listview_listviewcomponent %}#toc-add) event
|
|
14
|
+
* When you click an associated button with the directive, the
|
|
15
|
+
* [`add`]({% slug api_listview_listviewcomponent %}#toc-add) event triggers
|
|
15
16
|
* ([see example]({% slug editing_listview %})).
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
|
-
* ```html
|
|
19
|
+
* ```html
|
|
19
20
|
* <kendo-listview>
|
|
20
21
|
* <ng-template kendoListViewHeaderTemplate>
|
|
21
22
|
* <button kendoListViewAddCommand>Add new</button>
|
|
@@ -8,14 +8,15 @@ import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
|
8
8
|
import { EditService } from '../edit.service';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
/**
|
|
11
|
-
* Represents the
|
|
11
|
+
* Represents the cancel command button directive of the Kendo UI ListView for Angular.
|
|
12
|
+
* Provides the `cancel` command of the ListView. You can apply this directive to any `button`
|
|
12
13
|
* element inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
|
|
13
|
-
* When an associated button with the directive
|
|
14
|
+
* When you click an associated button with the directive, the
|
|
14
15
|
* [`cancel`]({% slug api_listview_listviewcomponent %}#toc-cancel) event
|
|
15
|
-
*
|
|
16
|
+
* triggers ([see example]({% slug editing_listview %})).
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
|
-
* ```html
|
|
19
|
+
* ```html
|
|
19
20
|
* <kendo-listview>
|
|
20
21
|
* <ng-template kendoListViewEditTemplate>
|
|
21
22
|
* <button kendoListViewCancelCommand>Cancel changes</button>
|
|
@@ -26,7 +27,7 @@ import * as i0 from "@angular/core";
|
|
|
26
27
|
* You can control the content of the button based on the state of the item.
|
|
27
28
|
*
|
|
28
29
|
* @example
|
|
29
|
-
* ```html
|
|
30
|
+
* ```html
|
|
30
31
|
* <kendo-listview>
|
|
31
32
|
* <ng-template kendoListViewEditTemplate let-isNew="isNew">
|
|
32
33
|
* <button kendoListViewCancelCommand>{{isNew ? 'Discard' : 'Cancel changes'}}</button>
|
|
@@ -8,21 +8,21 @@ import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
|
8
8
|
import { EditService } from '../edit.service';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
/**
|
|
11
|
-
* Represents the
|
|
11
|
+
* Represents the edit command button directive of the Kendo UI ListView for Angular.
|
|
12
|
+
* Provides the `edit` command of the ListView. You can apply this directive to any `button`
|
|
12
13
|
* element inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
|
|
13
|
-
* When an associated button with the directive
|
|
14
|
+
* When you click an associated button with the directive, the
|
|
14
15
|
* [`edit`]({% slug api_listview_listviewcomponent %}#toc-edit) event
|
|
15
|
-
*
|
|
16
|
+
* triggers ([see example]({% slug editing_listview %})).
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
|
-
* ```html
|
|
19
|
+
* ```html
|
|
19
20
|
* <kendo-listview>
|
|
20
21
|
* <ng-template kendoListViewEditTemplate>
|
|
21
22
|
* <button kendoListViewEditCommand class="k-primary">Edit</button>
|
|
22
23
|
* </ng-template>
|
|
23
24
|
* </kendo-listview>
|
|
24
25
|
* ```
|
|
25
|
-
*
|
|
26
26
|
*/
|
|
27
27
|
export declare class EditCommandDirective extends Button {
|
|
28
28
|
private editService;
|
|
@@ -8,14 +8,15 @@ import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
|
8
8
|
import { EditService } from '../edit.service';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
/**
|
|
11
|
-
* Represents the
|
|
11
|
+
* Represents the remove command button directive of the Kendo UI ListView for Angular.
|
|
12
|
+
* Provides the `remove` command of the ListView. You can apply this directive to any `button` element
|
|
12
13
|
* inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
|
|
13
|
-
* When an associated button with the directive
|
|
14
|
-
* [`remove`
|
|
15
|
-
*
|
|
14
|
+
* When you click an associated button with the directive, the
|
|
15
|
+
* [`remove`]({% slug api_listview_listviewcomponent %}#toc-remove) event
|
|
16
|
+
* triggers ([see example]({% slug editing_listview %})).
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
|
-
* ```html
|
|
19
|
+
* ```html
|
|
19
20
|
* <kendo-listview>
|
|
20
21
|
* <ng-template kendoListViewEditTemplate>
|
|
21
22
|
* <button kendoListViewRemoveCommand>Remove item</button>
|
|
@@ -8,14 +8,15 @@ import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
|
8
8
|
import { EditService } from '../edit.service';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
/**
|
|
11
|
-
* Represents the
|
|
11
|
+
* Represents the save command button directive of the Kendo UI ListView for Angular.
|
|
12
|
+
* Provides the `save` command of the ListView. You can apply this directive to any `button`
|
|
12
13
|
* element inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
|
|
13
|
-
* When an associated button with the directive
|
|
14
|
+
* When you click an associated button with the directive, the
|
|
14
15
|
* [`save`]({% slug api_listview_listviewcomponent %}#toc-save) event
|
|
15
|
-
*
|
|
16
|
+
* triggers ([see example]({% slug editing_listview %})).
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
|
-
* ```html
|
|
19
|
+
* ```html
|
|
19
20
|
* <kendo-listview>
|
|
20
21
|
* <ng-template kendoListViewEditTemplate>
|
|
21
22
|
* <button kendoListViewSaveCommand>Save changes</button>
|
|
@@ -26,7 +27,7 @@ import * as i0 from "@angular/core";
|
|
|
26
27
|
* You can control the content of the button based on the state of the item.
|
|
27
28
|
*
|
|
28
29
|
* @example
|
|
29
|
-
* ```html
|
|
30
|
+
* ```html
|
|
30
31
|
* <kendo-listview>
|
|
31
32
|
* <ng-template kendoListViewEditTemplate let-isNew="isNew">
|
|
32
33
|
* <button kendoListViewSaveCommand>{{isNew ? 'Add' : 'Update'}}</button>
|
|
@@ -5,16 +5,34 @@
|
|
|
5
5
|
import { TemplateRef } from '@angular/core';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* Helps
|
|
8
|
+
* Defines the edit template of the ListView ([see example]({% slug editing_template_forms_listview %})).
|
|
9
|
+
* Helps you customize the content of the edited items. To define the template, nest an `<ng-template>`
|
|
10
10
|
* tag with the `kendoListViewEditTemplate` directive inside a `<kendo-listview>` tag.
|
|
11
11
|
*
|
|
12
12
|
* The template context contains the following fields:
|
|
13
|
-
* - `formGroup`—The current [`FormGroup`](link:site.data.urls.angular['formgroupapi']).
|
|
14
|
-
*
|
|
15
|
-
* - `itemIndex`—The current item index. If inside a new item, `itemIndex` is `-1`.
|
|
13
|
+
* - `formGroup`—The current [`FormGroup`](link:site.data.urls.angular['formgroupapi']). When you use the ListView inside [Template-Driven Forms](link:site.data.urls.angular['forms']), it will be `undefined`.
|
|
14
|
+
* - `itemIndex`—The current item index. When inside a new item, `itemIndex` is `-1`.
|
|
16
15
|
* - `dataItem`—The current data item.
|
|
17
16
|
* - `isNew`—The state of the current item.
|
|
17
|
+
*
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* @Component({
|
|
22
|
+
* template: `
|
|
23
|
+
* <kendo-listview [data]="items">
|
|
24
|
+
* <ng-template kendoListViewEditTemplate let-dataItem let-formGroup="formGroup">
|
|
25
|
+
* <div class="edit-form">
|
|
26
|
+
* <input [(ngModel)]="dataItem.name" [formControl]="formGroup.get('name')" />
|
|
27
|
+
* <button kendoListViewSaveCommand>Save</button>
|
|
28
|
+
* <button kendoListViewCancelCommand>Cancel</button>
|
|
29
|
+
* </div>
|
|
30
|
+
* </ng-template>
|
|
31
|
+
* </kendo-listview>
|
|
32
|
+
* `
|
|
33
|
+
* })
|
|
34
|
+
* export class AppComponent { }
|
|
35
|
+
* ```
|
|
18
36
|
*/
|
|
19
37
|
export declare class EditTemplateDirective {
|
|
20
38
|
templateRef: TemplateRef<any>;
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { EditEvent } from "./edit-event-args.interface";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Defines the arguments for the `add` event.
|
|
8
|
+
*
|
|
8
9
|
*/
|
|
9
10
|
export interface AddEvent extends EditEvent {
|
|
10
11
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { SaveEvent } from "./save-event-args.interface";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Defines the arguments for the `cancel` event.
|
|
8
|
+
*
|
|
8
9
|
*/
|
|
9
10
|
export type CancelEvent = SaveEvent;
|
|
@@ -4,23 +4,24 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { ListViewComponent } from "../../listview.component";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Defines the arguments for the `edit` event.
|
|
8
|
+
*
|
|
8
9
|
*/
|
|
9
10
|
export interface EditEvent {
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* Specifies the data item.
|
|
12
13
|
*/
|
|
13
14
|
dataItem: any;
|
|
14
15
|
/**
|
|
15
|
-
* Indicates
|
|
16
|
+
* Indicates whether the data item is new or existing.
|
|
16
17
|
*/
|
|
17
18
|
isNew: boolean;
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* Specifies the item index for the operation.
|
|
20
21
|
*/
|
|
21
22
|
itemIndex: number;
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
+
* Specifies the `ListViewComponent` instance.
|
|
24
25
|
*/
|
|
25
26
|
sender: ListViewComponent;
|
|
26
27
|
}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { EditEvent } from "./edit-event-args.interface";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Defines the arguments for the `remove` event.
|
|
8
|
+
*
|
|
8
9
|
*/
|
|
9
10
|
export interface RemoveEvent extends EditEvent {
|
|
10
11
|
}
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
import { EditEvent } from "./edit-event-args.interface";
|
|
6
6
|
import { FormGroup } from "@angular/forms";
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Defines the arguments for the `save` event.
|
|
9
|
+
*
|
|
9
10
|
*/
|
|
10
11
|
export interface SaveEvent extends EditEvent {
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
+
* Specifies the edited `FormGroup` instance.
|
|
13
14
|
*/
|
|
14
15
|
formGroup: FormGroup;
|
|
15
16
|
}
|
|
@@ -8,13 +8,30 @@ import { ListViewComponent } from '../listview.component';
|
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
import * as i1 from "../listview.component";
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Encapsulates the in-memory handling of paging for the ListView component
|
|
12
12
|
* ([see example]({% slug paging_listview %}#toc-binding-directive)).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* @Component({
|
|
17
|
+
* selector: 'my-app',
|
|
18
|
+
* template: `
|
|
19
|
+
* <kendo-listview [kendoListViewBinding]="listItems">
|
|
20
|
+
* <ng-template kendoListViewItemTemplate let-dataItem>
|
|
21
|
+
* <div>{{ dataItem.name }}</div>
|
|
22
|
+
* </ng-template>
|
|
23
|
+
* </kendo-listview>
|
|
24
|
+
* `
|
|
25
|
+
* })
|
|
26
|
+
* export class AppComponent {
|
|
27
|
+
* listItems = [{ name: 'Item 1' }, { name: 'Item 2' }];
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
13
30
|
*/
|
|
14
31
|
export class DataBindingDirective {
|
|
15
32
|
listView;
|
|
16
33
|
/**
|
|
17
|
-
*
|
|
34
|
+
* Specifies the array of data that populates the ListView.
|
|
18
35
|
*/
|
|
19
36
|
set data(data) {
|
|
20
37
|
this._data = data || [];
|
|
@@ -12,14 +12,15 @@ import * as i0 from "@angular/core";
|
|
|
12
12
|
import * as i1 from "../edit.service";
|
|
13
13
|
import * as i2 from "@progress/kendo-angular-l10n";
|
|
14
14
|
/**
|
|
15
|
-
* Represents the command
|
|
15
|
+
* Represents the add command button directive of the Kendo UI ListView for Angular.
|
|
16
|
+
* Provides the command for adding a new item to the ListView. You can apply this directive to any
|
|
16
17
|
* `button` element inside a [`HeaderTemplate`]({% slug api_listview_headertemplatedirective %}).
|
|
17
|
-
* When an associated button with the directive
|
|
18
|
-
* [`add`]({% slug api_listview_listviewcomponent %}#toc-add) event
|
|
18
|
+
* When you click an associated button with the directive, the
|
|
19
|
+
* [`add`]({% slug api_listview_listviewcomponent %}#toc-add) event triggers
|
|
19
20
|
* ([see example]({% slug editing_listview %})).
|
|
20
21
|
*
|
|
21
22
|
* @example
|
|
22
|
-
* ```html
|
|
23
|
+
* ```html
|
|
23
24
|
* <kendo-listview>
|
|
24
25
|
* <ng-template kendoListViewHeaderTemplate>
|
|
25
26
|
* <button kendoListViewAddCommand>Add new</button>
|
|
@@ -13,14 +13,15 @@ import * as i0 from "@angular/core";
|
|
|
13
13
|
import * as i1 from "../edit.service";
|
|
14
14
|
import * as i2 from "@progress/kendo-angular-l10n";
|
|
15
15
|
/**
|
|
16
|
-
* Represents the
|
|
16
|
+
* Represents the cancel command button directive of the Kendo UI ListView for Angular.
|
|
17
|
+
* Provides the `cancel` command of the ListView. You can apply this directive to any `button`
|
|
17
18
|
* element inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
|
|
18
|
-
* When an associated button with the directive
|
|
19
|
+
* When you click an associated button with the directive, the
|
|
19
20
|
* [`cancel`]({% slug api_listview_listviewcomponent %}#toc-cancel) event
|
|
20
|
-
*
|
|
21
|
+
* triggers ([see example]({% slug editing_listview %})).
|
|
21
22
|
*
|
|
22
23
|
* @example
|
|
23
|
-
* ```html
|
|
24
|
+
* ```html
|
|
24
25
|
* <kendo-listview>
|
|
25
26
|
* <ng-template kendoListViewEditTemplate>
|
|
26
27
|
* <button kendoListViewCancelCommand>Cancel changes</button>
|
|
@@ -31,7 +32,7 @@ import * as i2 from "@progress/kendo-angular-l10n";
|
|
|
31
32
|
* You can control the content of the button based on the state of the item.
|
|
32
33
|
*
|
|
33
34
|
* @example
|
|
34
|
-
* ```html
|
|
35
|
+
* ```html
|
|
35
36
|
* <kendo-listview>
|
|
36
37
|
* <ng-template kendoListViewEditTemplate let-isNew="isNew">
|
|
37
38
|
* <button kendoListViewCancelCommand>{{isNew ? 'Discard' : 'Cancel changes'}}</button>
|
|
@@ -13,21 +13,21 @@ import * as i0 from "@angular/core";
|
|
|
13
13
|
import * as i1 from "../edit.service";
|
|
14
14
|
import * as i2 from "@progress/kendo-angular-l10n";
|
|
15
15
|
/**
|
|
16
|
-
* Represents the
|
|
16
|
+
* Represents the edit command button directive of the Kendo UI ListView for Angular.
|
|
17
|
+
* Provides the `edit` command of the ListView. You can apply this directive to any `button`
|
|
17
18
|
* element inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
|
|
18
|
-
* When an associated button with the directive
|
|
19
|
+
* When you click an associated button with the directive, the
|
|
19
20
|
* [`edit`]({% slug api_listview_listviewcomponent %}#toc-edit) event
|
|
20
|
-
*
|
|
21
|
+
* triggers ([see example]({% slug editing_listview %})).
|
|
21
22
|
*
|
|
22
23
|
* @example
|
|
23
|
-
* ```html
|
|
24
|
+
* ```html
|
|
24
25
|
* <kendo-listview>
|
|
25
26
|
* <ng-template kendoListViewEditTemplate>
|
|
26
27
|
* <button kendoListViewEditCommand class="k-primary">Edit</button>
|
|
27
28
|
* </ng-template>
|
|
28
29
|
* </kendo-listview>
|
|
29
30
|
* ```
|
|
30
|
-
*
|
|
31
31
|
*/
|
|
32
32
|
export class EditCommandDirective extends Button {
|
|
33
33
|
editService;
|
|
@@ -13,14 +13,15 @@ import * as i0 from "@angular/core";
|
|
|
13
13
|
import * as i1 from "../edit.service";
|
|
14
14
|
import * as i2 from "@progress/kendo-angular-l10n";
|
|
15
15
|
/**
|
|
16
|
-
* Represents the
|
|
16
|
+
* Represents the remove command button directive of the Kendo UI ListView for Angular.
|
|
17
|
+
* Provides the `remove` command of the ListView. You can apply this directive to any `button` element
|
|
17
18
|
* inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
|
|
18
|
-
* When an associated button with the directive
|
|
19
|
-
* [`remove`
|
|
20
|
-
*
|
|
19
|
+
* When you click an associated button with the directive, the
|
|
20
|
+
* [`remove`]({% slug api_listview_listviewcomponent %}#toc-remove) event
|
|
21
|
+
* triggers ([see example]({% slug editing_listview %})).
|
|
21
22
|
*
|
|
22
23
|
* @example
|
|
23
|
-
* ```html
|
|
24
|
+
* ```html
|
|
24
25
|
* <kendo-listview>
|
|
25
26
|
* <ng-template kendoListViewEditTemplate>
|
|
26
27
|
* <button kendoListViewRemoveCommand>Remove item</button>
|
|
@@ -13,14 +13,15 @@ import * as i0 from "@angular/core";
|
|
|
13
13
|
import * as i1 from "../edit.service";
|
|
14
14
|
import * as i2 from "@progress/kendo-angular-l10n";
|
|
15
15
|
/**
|
|
16
|
-
* Represents the
|
|
16
|
+
* Represents the save command button directive of the Kendo UI ListView for Angular.
|
|
17
|
+
* Provides the `save` command of the ListView. You can apply this directive to any `button`
|
|
17
18
|
* element inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
|
|
18
|
-
* When an associated button with the directive
|
|
19
|
+
* When you click an associated button with the directive, the
|
|
19
20
|
* [`save`]({% slug api_listview_listviewcomponent %}#toc-save) event
|
|
20
|
-
*
|
|
21
|
+
* triggers ([see example]({% slug editing_listview %})).
|
|
21
22
|
*
|
|
22
23
|
* @example
|
|
23
|
-
* ```html
|
|
24
|
+
* ```html
|
|
24
25
|
* <kendo-listview>
|
|
25
26
|
* <ng-template kendoListViewEditTemplate>
|
|
26
27
|
* <button kendoListViewSaveCommand>Save changes</button>
|
|
@@ -31,7 +32,7 @@ import * as i2 from "@progress/kendo-angular-l10n";
|
|
|
31
32
|
* You can control the content of the button based on the state of the item.
|
|
32
33
|
*
|
|
33
34
|
* @example
|
|
34
|
-
* ```html
|
|
35
|
+
* ```html
|
|
35
36
|
* <kendo-listview>
|
|
36
37
|
* <ng-template kendoListViewEditTemplate let-isNew="isNew">
|
|
37
38
|
* <button kendoListViewSaveCommand>{{isNew ? 'Add' : 'Update'}}</button>
|
|
@@ -5,16 +5,34 @@
|
|
|
5
5
|
import { Directive, TemplateRef, Optional } from '@angular/core';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* Helps
|
|
8
|
+
* Defines the edit template of the ListView ([see example]({% slug editing_template_forms_listview %})).
|
|
9
|
+
* Helps you customize the content of the edited items. To define the template, nest an `<ng-template>`
|
|
10
10
|
* tag with the `kendoListViewEditTemplate` directive inside a `<kendo-listview>` tag.
|
|
11
11
|
*
|
|
12
12
|
* The template context contains the following fields:
|
|
13
|
-
* - `formGroup`—The current [`FormGroup`](link:site.data.urls.angular['formgroupapi']).
|
|
14
|
-
*
|
|
15
|
-
* - `itemIndex`—The current item index. If inside a new item, `itemIndex` is `-1`.
|
|
13
|
+
* - `formGroup`—The current [`FormGroup`](link:site.data.urls.angular['formgroupapi']). When you use the ListView inside [Template-Driven Forms](link:site.data.urls.angular['forms']), it will be `undefined`.
|
|
14
|
+
* - `itemIndex`—The current item index. When inside a new item, `itemIndex` is `-1`.
|
|
16
15
|
* - `dataItem`—The current data item.
|
|
17
16
|
* - `isNew`—The state of the current item.
|
|
17
|
+
*
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* @Component({
|
|
22
|
+
* template: `
|
|
23
|
+
* <kendo-listview [data]="items">
|
|
24
|
+
* <ng-template kendoListViewEditTemplate let-dataItem let-formGroup="formGroup">
|
|
25
|
+
* <div class="edit-form">
|
|
26
|
+
* <input [(ngModel)]="dataItem.name" [formControl]="formGroup.get('name')" />
|
|
27
|
+
* <button kendoListViewSaveCommand>Save</button>
|
|
28
|
+
* <button kendoListViewCancelCommand>Cancel</button>
|
|
29
|
+
* </div>
|
|
30
|
+
* </ng-template>
|
|
31
|
+
* </kendo-listview>
|
|
32
|
+
* `
|
|
33
|
+
* })
|
|
34
|
+
* export class AppComponent { }
|
|
35
|
+
* ```
|
|
18
36
|
*/
|
|
19
37
|
export class EditTemplateDirective {
|
|
20
38
|
templateRef;
|