@memberjunction/ng-user-view-grid 2.42.1 → 2.44.0
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/README.md +294 -113
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
# @memberjunction/ng-user-view-grid
|
|
2
2
|
|
|
3
|
-
The `@memberjunction/ng-user-view-grid` package provides a powerful grid component for displaying both saved and dynamic views of MemberJunction entity data. It offers a
|
|
3
|
+
The `@memberjunction/ng-user-view-grid` package provides a powerful Angular grid component for displaying both saved and dynamic views of MemberJunction entity data. It offers a comprehensive set of features for viewing, editing, exporting, comparing, and merging entity records with full integration into the MemberJunction ecosystem.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
7
|
+
- **View Management**
|
|
8
|
+
- Display entities using saved user views or dynamic configurations
|
|
9
|
+
- Support for both stored views (by ID) and dynamic views (by entity/filter)
|
|
10
|
+
- Virtual scrolling for optimal performance with large datasets
|
|
11
|
+
- Customizable columns with reordering, resizing, and sorting
|
|
12
|
+
- Column formatting based on entity field types
|
|
13
|
+
|
|
14
|
+
- **Data Operations**
|
|
15
|
+
- Inline record editing with validation
|
|
16
|
+
- Create new records directly from the grid (dialog or tab mode)
|
|
17
|
+
- Export to Excel with formatted data
|
|
18
|
+
- Record comparison and merging capabilities
|
|
19
|
+
- Duplicate detection functionality
|
|
20
|
+
- Add records to lists for organization
|
|
21
|
+
|
|
22
|
+
- **Integration Features**
|
|
23
|
+
- Entity action execution from the grid
|
|
24
|
+
- Communication capabilities (send emails related to records)
|
|
25
|
+
- Role-based permission controls for all operations
|
|
26
|
+
- Auto-save and queue-based editing modes
|
|
27
|
+
- Navigation to record details on row click
|
|
19
28
|
|
|
20
29
|
## Installation
|
|
21
30
|
|
|
@@ -25,21 +34,41 @@ npm install @memberjunction/ng-user-view-grid
|
|
|
25
34
|
|
|
26
35
|
## Requirements
|
|
27
36
|
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
+
### Angular Version
|
|
38
|
+
- Angular 18.0.2 or higher
|
|
39
|
+
|
|
40
|
+
### Peer Dependencies
|
|
41
|
+
- `@angular/common`: ^18.0.2
|
|
42
|
+
- `@angular/core`: ^18.0.2
|
|
43
|
+
- `@angular/forms`: ^18.0.2
|
|
44
|
+
- `@angular/router`: ^18.0.2
|
|
45
|
+
|
|
46
|
+
### MemberJunction Dependencies
|
|
47
|
+
- `@memberjunction/global`: ^2.43.0
|
|
48
|
+
- `@memberjunction/core`: ^2.43.0
|
|
49
|
+
- `@memberjunction/core-entities`: ^2.43.0
|
|
50
|
+
- `@memberjunction/entity-communications-client`: ^2.43.0
|
|
51
|
+
- `@memberjunction/communication-types`: ^2.43.0
|
|
52
|
+
- `@memberjunction/templates-base-types`: ^2.43.0
|
|
53
|
+
- `@memberjunction/actions-base`: ^2.43.0
|
|
54
|
+
- `@memberjunction/ng-shared`: ^2.43.0
|
|
55
|
+
- `@memberjunction/ng-entity-form-dialog`: ^2.43.0
|
|
56
|
+
- `@memberjunction/ng-compare-records`: ^2.43.0
|
|
57
|
+
- `@memberjunction/ng-container-directives`: ^2.43.0
|
|
58
|
+
- `@memberjunction/ng-entity-communications`: ^2.43.0
|
|
59
|
+
- `@memberjunction/ng-base-types`: ^2.43.0
|
|
60
|
+
|
|
61
|
+
### Kendo UI Dependencies
|
|
62
|
+
- `@progress/kendo-angular-grid`: ^16.2.0
|
|
63
|
+
- `@progress/kendo-angular-layout`: ^16.2.0
|
|
64
|
+
- `@progress/kendo-angular-inputs`: ^16.2.0
|
|
65
|
+
- `@progress/kendo-angular-buttons`: ^16.2.0
|
|
37
66
|
|
|
38
67
|
## Usage
|
|
39
68
|
|
|
40
|
-
###
|
|
69
|
+
### Module Setup
|
|
41
70
|
|
|
42
|
-
|
|
71
|
+
Import the `UserViewGridModule` in your Angular module:
|
|
43
72
|
|
|
44
73
|
```typescript
|
|
45
74
|
import { UserViewGridModule } from '@memberjunction/ng-user-view-grid';
|
|
@@ -53,7 +82,7 @@ import { UserViewGridModule } from '@memberjunction/ng-user-view-grid';
|
|
|
53
82
|
export class YourModule { }
|
|
54
83
|
```
|
|
55
84
|
|
|
56
|
-
### Basic
|
|
85
|
+
### Basic Example
|
|
57
86
|
|
|
58
87
|
Use the component in your template:
|
|
59
88
|
|
|
@@ -67,7 +96,7 @@ Use the component in your template:
|
|
|
67
96
|
</mj-user-view-grid>
|
|
68
97
|
```
|
|
69
98
|
|
|
70
|
-
|
|
99
|
+
Component implementation:
|
|
71
100
|
|
|
72
101
|
```typescript
|
|
73
102
|
import { Component } from '@angular/core';
|
|
@@ -79,15 +108,16 @@ import { GridRowClickedEvent, GridRowEditedEvent } from '@memberjunction/ng-user
|
|
|
79
108
|
templateUrl: './my-view.component.html',
|
|
80
109
|
})
|
|
81
110
|
export class MyViewComponent {
|
|
82
|
-
// Using a saved view by ID
|
|
111
|
+
// Option 1: Using a saved view by ID
|
|
83
112
|
viewParams: RunViewParams = {
|
|
84
113
|
ViewID: 'view-id-here'
|
|
85
114
|
};
|
|
86
115
|
|
|
87
|
-
//
|
|
116
|
+
// Option 2: Using a dynamic view with entity and filter
|
|
88
117
|
dynamicViewParams: RunViewParams = {
|
|
89
118
|
EntityName: 'Customer',
|
|
90
119
|
ExtraFilter: "Status = 'Active'",
|
|
120
|
+
OrderBy: 'Name ASC',
|
|
91
121
|
Skip: 0,
|
|
92
122
|
Take: 40
|
|
93
123
|
};
|
|
@@ -104,9 +134,9 @@ export class MyViewComponent {
|
|
|
104
134
|
}
|
|
105
135
|
```
|
|
106
136
|
|
|
107
|
-
### Editing
|
|
137
|
+
### Editing Records
|
|
108
138
|
|
|
109
|
-
Enable inline editing
|
|
139
|
+
Enable inline editing with different save modes:
|
|
110
140
|
|
|
111
141
|
```html
|
|
112
142
|
<mj-user-view-grid
|
|
@@ -117,14 +147,29 @@ Enable inline editing in the grid:
|
|
|
117
147
|
</mj-user-view-grid>
|
|
118
148
|
```
|
|
119
149
|
|
|
150
|
+
```typescript
|
|
151
|
+
// Component
|
|
152
|
+
export class MyViewComponent {
|
|
153
|
+
editMode: "None" | "Save" | "Queue" = "Save";
|
|
154
|
+
|
|
155
|
+
onRowEdited(event: GridRowEditedEvent) {
|
|
156
|
+
if (event.saved) {
|
|
157
|
+
console.log('Record saved successfully:', event.record);
|
|
158
|
+
} else {
|
|
159
|
+
console.log('Record queued for saving:', event.record);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
120
165
|
The `EditMode` property supports three values:
|
|
121
166
|
- `"None"` - Editing is disabled
|
|
122
|
-
- `"Save"` - Changes are saved immediately
|
|
123
|
-
- `"Queue"` - Changes are queued for
|
|
167
|
+
- `"Save"` - Changes are saved immediately to the database
|
|
168
|
+
- `"Queue"` - Changes are queued locally for batch saving later
|
|
124
169
|
|
|
125
|
-
###
|
|
170
|
+
### Creating New Records
|
|
126
171
|
|
|
127
|
-
|
|
172
|
+
Configure new record creation behavior:
|
|
128
173
|
|
|
129
174
|
```html
|
|
130
175
|
<mj-user-view-grid
|
|
@@ -135,13 +180,25 @@ Control how new records are created:
|
|
|
135
180
|
</mj-user-view-grid>
|
|
136
181
|
```
|
|
137
182
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
183
|
+
```typescript
|
|
184
|
+
// Component
|
|
185
|
+
export class MyViewComponent {
|
|
186
|
+
// Pre-populate new records with default values
|
|
187
|
+
initialValues = {
|
|
188
|
+
Status: 'Active',
|
|
189
|
+
CreatedDate: new Date(),
|
|
190
|
+
DepartmentID: 123
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
The `CreateRecordMode` property supports:
|
|
196
|
+
- `"Dialog"` - Opens a modal dialog to create a new record
|
|
197
|
+
- `"Tab"` - Opens a new browser tab to create a new record
|
|
141
198
|
|
|
142
199
|
### Entity Actions and Communication
|
|
143
200
|
|
|
144
|
-
|
|
201
|
+
Enable entity-specific actions and communication features:
|
|
145
202
|
|
|
146
203
|
```html
|
|
147
204
|
<mj-user-view-grid
|
|
@@ -151,129 +208,253 @@ Control additional features:
|
|
|
151
208
|
</mj-user-view-grid>
|
|
152
209
|
```
|
|
153
210
|
|
|
211
|
+
These features integrate with:
|
|
212
|
+
- **Entity Actions**: Execute custom actions defined in entity metadata
|
|
213
|
+
- **Communications**: Send emails or other communications related to selected records
|
|
214
|
+
|
|
154
215
|
## API Reference
|
|
155
216
|
|
|
156
217
|
### UserViewGridComponent
|
|
157
218
|
|
|
219
|
+
The main component for displaying entity data in a grid format.
|
|
220
|
+
|
|
158
221
|
#### Inputs
|
|
159
222
|
|
|
160
223
|
| Name | Type | Default | Description |
|
|
161
224
|
|------|------|---------|-------------|
|
|
162
|
-
| `Params` | `RunViewParams` | `undefined` | Parameters
|
|
163
|
-
| `BottomMargin` | `number` | `0` |
|
|
164
|
-
| `InEditMode` | `boolean` | `false` |
|
|
165
|
-
| `EditMode` | `"None" \| "Save" \| "Queue"` | `"None"` |
|
|
166
|
-
| `AutoNavigate` | `boolean` | `true` | Whether to
|
|
167
|
-
| `NewRecordValues` | `any` | `undefined` |
|
|
168
|
-
| `ShowCreateNewRecordButton` | `boolean` | `true` | Whether to
|
|
169
|
-
| `ShowEntityActionButtons` | `boolean` | `true` | Whether to
|
|
170
|
-
| `ShowCommunicationButton` | `boolean` | `true` | Whether to
|
|
171
|
-
| `CreateRecordMode` | `"Dialog" \| "Tab"` | `"Tab"` | How to open the new record form |
|
|
172
|
-
| `AllowLoad` | `boolean` | `true` |
|
|
225
|
+
| `Params` | `RunViewParams` | `undefined` | Parameters defining which view to display (either ViewID for saved views or EntityName with filters for dynamic views) |
|
|
226
|
+
| `BottomMargin` | `number` | `0` | Bottom margin in pixels to apply to the grid container |
|
|
227
|
+
| `InEditMode` | `boolean` | `false` | Controls whether the grid is currently in edit mode |
|
|
228
|
+
| `EditMode` | `"None" \| "Save" \| "Queue"` | `"None"` | Determines how edits are handled: None (no editing), Save (immediate), or Queue (batch) |
|
|
229
|
+
| `AutoNavigate` | `boolean` | `true` | Whether to automatically navigate to a record's detail view when clicked |
|
|
230
|
+
| `NewRecordValues` | `any` | `undefined` | Default values to populate when creating new records |
|
|
231
|
+
| `ShowCreateNewRecordButton` | `boolean` | `true` | Whether to display the Create New Record button (if user has permission) |
|
|
232
|
+
| `ShowEntityActionButtons` | `boolean` | `true` | Whether to display entity action buttons for the current entity |
|
|
233
|
+
| `ShowCommunicationButton` | `boolean` | `true` | Whether to display the communication button (if entity supports it) |
|
|
234
|
+
| `CreateRecordMode` | `"Dialog" \| "Tab"` | `"Tab"` | How to open the new record form: Dialog (modal) or Tab (new browser tab) |
|
|
235
|
+
| `AllowLoad` | `boolean` | `true` | Controls whether the grid loads data. Set to false to defer loading until ready |
|
|
173
236
|
|
|
174
237
|
#### Outputs
|
|
175
238
|
|
|
176
239
|
| Name | Type | Description |
|
|
177
240
|
|------|------|-------------|
|
|
178
|
-
| `rowClicked` | `EventEmitter<GridRowClickedEvent>` |
|
|
179
|
-
| `rowEdited` | `EventEmitter<GridRowEditedEvent>` |
|
|
241
|
+
| `rowClicked` | `EventEmitter<GridRowClickedEvent>` | Fired when a user clicks on a grid row |
|
|
242
|
+
| `rowEdited` | `EventEmitter<GridRowEditedEvent>` | Fired when a row edit is completed (saved or queued) |
|
|
180
243
|
|
|
181
|
-
#### Methods
|
|
244
|
+
#### Public Methods
|
|
182
245
|
|
|
183
246
|
| Name | Parameters | Return Type | Description |
|
|
184
247
|
|------|------------|-------------|-------------|
|
|
185
|
-
| `Refresh` | `params: RunViewParams` | `Promise<void>` | Refreshes the grid
|
|
186
|
-
| `RefreshFromSavedParams` | None | `Promise<void>` | Refreshes using the
|
|
187
|
-
| `EditingComplete` | None | `Promise<boolean>` | Completes
|
|
188
|
-
| `RevertPendingChanges` | None | `void` | Reverts all pending changes |
|
|
189
|
-
| `enableMergeOrCompare` | `cancel: boolean, type: 'merge' \| 'compare'` | `void` | Enables
|
|
190
|
-
| `enableCheckbox` | `cancel: boolean, type: 'merge' \| 'compare' \| 'duplicate' \| 'addToList' \| ''` | `void` | Enables selection
|
|
191
|
-
| `doExcelExport` | None | `Promise<void>` | Exports the
|
|
248
|
+
| `Refresh` | `params: RunViewParams` | `Promise<void>` | Refreshes the grid with new view parameters |
|
|
249
|
+
| `RefreshFromSavedParams` | None | `Promise<void>` | Refreshes the grid using the currently stored parameters |
|
|
250
|
+
| `EditingComplete` | None | `Promise<boolean>` | Completes any in-progress editing and returns true when done |
|
|
251
|
+
| `RevertPendingChanges` | None | `void` | Reverts all pending changes in Queue mode |
|
|
252
|
+
| `enableMergeOrCompare` | `cancel: boolean, type: 'merge' \| 'compare'` | `void` | Enables or disables merge/compare selection mode |
|
|
253
|
+
| `enableCheckbox` | `cancel: boolean, type: 'merge' \| 'compare' \| 'duplicate' \| 'addToList' \| ''` | `void` | Enables checkbox selection for various operations |
|
|
254
|
+
| `doExcelExport` | None | `Promise<void>` | Exports the current view data to Excel format |
|
|
192
255
|
|
|
193
|
-
|
|
256
|
+
#### Public Properties
|
|
257
|
+
|
|
258
|
+
| Name | Type | Description |
|
|
259
|
+
|------|------|-------------|
|
|
260
|
+
| `PendingRecords` | `GridPendingRecordItem[]` | Array of records with pending changes (readonly) |
|
|
261
|
+
| `ViewID` | `string` | The ID of the current view being displayed (readonly) |
|
|
262
|
+
| `UserCanCreateNewRecord` | `boolean` | Whether the current user can create new records (readonly) |
|
|
263
|
+
| `UserCanEdit` | `boolean` | Whether the current user can edit the view (readonly) |
|
|
264
|
+
|
|
265
|
+
### Type Definitions
|
|
194
266
|
|
|
195
267
|
#### GridRowClickedEvent
|
|
196
268
|
|
|
269
|
+
Emitted when a user clicks on a grid row:
|
|
270
|
+
|
|
197
271
|
```typescript
|
|
198
272
|
type GridRowClickedEvent = {
|
|
199
|
-
entityId: string;
|
|
200
|
-
entityName: string;
|
|
201
|
-
CompositeKey: CompositeKey;
|
|
273
|
+
entityId: string; // The ID of the clicked entity
|
|
274
|
+
entityName: string; // The name of the entity type
|
|
275
|
+
CompositeKey: CompositeKey; // Composite key object for multi-key entities
|
|
202
276
|
}
|
|
203
277
|
```
|
|
204
278
|
|
|
205
279
|
#### GridRowEditedEvent
|
|
206
280
|
|
|
281
|
+
Emitted when a row edit is completed:
|
|
282
|
+
|
|
207
283
|
```typescript
|
|
208
284
|
type GridRowEditedEvent = {
|
|
209
|
-
record: BaseEntity;
|
|
210
|
-
row: number;
|
|
211
|
-
saved: boolean;
|
|
285
|
+
record: BaseEntity; // The edited entity record
|
|
286
|
+
row: number; // The row index in the grid
|
|
287
|
+
saved: boolean; // Whether the record was saved (true) or queued (false)
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
#### GridPendingRecordItem
|
|
292
|
+
|
|
293
|
+
Represents a record with pending changes:
|
|
294
|
+
|
|
295
|
+
```typescript
|
|
296
|
+
type GridPendingRecordItem = {
|
|
297
|
+
record: BaseEntity; // The entity record with changes
|
|
298
|
+
row: number; // The row index in the grid
|
|
299
|
+
dataItem: any; // The raw data item from the view
|
|
212
300
|
}
|
|
213
301
|
```
|
|
214
302
|
|
|
215
|
-
## Features
|
|
303
|
+
## Advanced Features
|
|
216
304
|
|
|
217
305
|
### Record Operations
|
|
218
306
|
|
|
219
|
-
The grid provides
|
|
307
|
+
The grid provides powerful multi-record operations:
|
|
220
308
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
3. **Duplicate Detection** - Select records and find potential duplicates based on field similarity
|
|
224
|
-
4. **List Management** - Add selected records to one or more lists for organization and later retrieval
|
|
309
|
+
#### Compare Records
|
|
310
|
+
Select multiple records to view their differences side-by-side:
|
|
225
311
|
|
|
226
|
-
|
|
312
|
+
```typescript
|
|
313
|
+
// Enable compare mode programmatically
|
|
314
|
+
@ViewChild(UserViewGridComponent) grid!: UserViewGridComponent;
|
|
227
315
|
|
|
228
|
-
|
|
316
|
+
startCompare() {
|
|
317
|
+
this.grid.enableCheckbox(false, 'compare');
|
|
318
|
+
}
|
|
319
|
+
```
|
|
229
320
|
|
|
230
|
-
|
|
231
|
-
|
|
321
|
+
#### Merge Records
|
|
322
|
+
Combine multiple records into a single record:
|
|
323
|
+
1. Select records to merge
|
|
324
|
+
2. Choose which field values to keep
|
|
325
|
+
3. Confirm the merge operation
|
|
326
|
+
|
|
327
|
+
#### Duplicate Detection
|
|
328
|
+
Find potential duplicate records based on field similarity:
|
|
329
|
+
1. Select records to check
|
|
330
|
+
2. System analyzes field similarities
|
|
331
|
+
3. Results are saved to a list for review
|
|
332
|
+
|
|
333
|
+
#### List Management
|
|
334
|
+
Add selected records to lists for organization:
|
|
335
|
+
|
|
336
|
+
```typescript
|
|
337
|
+
// Enable add to list mode
|
|
338
|
+
addToLists() {
|
|
339
|
+
this.grid.enableCheckbox(false, 'addToList');
|
|
340
|
+
}
|
|
341
|
+
```
|
|
232
342
|
|
|
233
343
|
### Excel Export
|
|
234
344
|
|
|
235
|
-
Export
|
|
345
|
+
Export grid data with formatting:
|
|
346
|
+
|
|
347
|
+
```typescript
|
|
348
|
+
async exportToExcel() {
|
|
349
|
+
await this.grid.doExcelExport();
|
|
350
|
+
// Notification will appear when complete
|
|
351
|
+
}
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Deferred Loading
|
|
355
|
+
|
|
356
|
+
Control when the grid loads data:
|
|
357
|
+
|
|
358
|
+
```html
|
|
359
|
+
<mj-user-view-grid
|
|
360
|
+
[Params]="viewParams"
|
|
361
|
+
[AllowLoad]="false"
|
|
362
|
+
#gridRef>
|
|
363
|
+
</mj-user-view-grid>
|
|
364
|
+
```
|
|
236
365
|
|
|
237
|
-
|
|
366
|
+
```typescript
|
|
367
|
+
// Load when ready
|
|
368
|
+
ngAfterViewInit() {
|
|
369
|
+
// Do some initialization...
|
|
370
|
+
setTimeout(() => {
|
|
371
|
+
this.gridRef.AllowLoad = true; // Grid will now load
|
|
372
|
+
}, 1000);
|
|
373
|
+
}
|
|
374
|
+
```
|
|
238
375
|
|
|
239
|
-
###
|
|
376
|
+
### Working with Pending Changes
|
|
240
377
|
|
|
241
|
-
|
|
378
|
+
In Queue mode, manage pending changes:
|
|
242
379
|
|
|
243
380
|
```typescript
|
|
244
|
-
//
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
381
|
+
// Access pending records
|
|
382
|
+
const pending = this.grid.PendingRecords;
|
|
383
|
+
console.log(`${pending.length} records have pending changes`);
|
|
384
|
+
|
|
385
|
+
// Revert all pending changes
|
|
386
|
+
this.grid.RevertPendingChanges();
|
|
387
|
+
|
|
388
|
+
// Complete editing and get status
|
|
389
|
+
const completed = await this.grid.EditingComplete();
|
|
390
|
+
if (completed) {
|
|
391
|
+
// All edits are complete
|
|
254
392
|
}
|
|
255
393
|
```
|
|
256
394
|
|
|
257
|
-
##
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
-
|
|
262
|
-
-
|
|
263
|
-
-
|
|
264
|
-
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
-
|
|
277
|
-
-
|
|
278
|
-
-
|
|
279
|
-
|
|
395
|
+
## Integration with MemberJunction
|
|
396
|
+
|
|
397
|
+
### Entity Permissions
|
|
398
|
+
|
|
399
|
+
The grid automatically respects entity-level permissions:
|
|
400
|
+
- Create button only shows if user has create permission
|
|
401
|
+
- Edit capabilities respect user's update permissions
|
|
402
|
+
- All operations check appropriate permissions
|
|
403
|
+
|
|
404
|
+
### Entity Actions
|
|
405
|
+
|
|
406
|
+
Entity actions defined in metadata appear automatically:
|
|
407
|
+
- Actions with 'View' invocation context are displayed
|
|
408
|
+
- Actions are filtered by status (only 'Active' shown)
|
|
409
|
+
- Custom action handlers can be implemented
|
|
410
|
+
|
|
411
|
+
### Communication Integration
|
|
412
|
+
|
|
413
|
+
For entities with communication support:
|
|
414
|
+
- Send emails to related contacts
|
|
415
|
+
- Use template-based communications
|
|
416
|
+
- Track communication history
|
|
417
|
+
|
|
418
|
+
## Best Practices
|
|
419
|
+
|
|
420
|
+
1. **Use ViewID for Saved Views**: When displaying user-created views, use the ViewID parameter for better performance and consistency
|
|
421
|
+
|
|
422
|
+
2. **Implement Error Handling**: Always handle errors in row edit events:
|
|
423
|
+
```typescript
|
|
424
|
+
onRowEdited(event: GridRowEditedEvent) {
|
|
425
|
+
if (!event.saved && this.editMode === 'Save') {
|
|
426
|
+
// Handle save failure
|
|
427
|
+
console.error('Failed to save record:', event.record);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
3. **Optimize Dynamic Views**: For dynamic views, use appropriate filters and pagination:
|
|
433
|
+
```typescript
|
|
434
|
+
dynamicParams: RunViewParams = {
|
|
435
|
+
EntityName: 'LargeTable',
|
|
436
|
+
ExtraFilter: 'IsActive = 1',
|
|
437
|
+
OrderBy: 'ModifiedDate DESC',
|
|
438
|
+
Take: 50 // Limit initial load
|
|
439
|
+
};
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
4. **Defer Loading for Complex Scenarios**: Use AllowLoad=false when you need to prepare data or configuration before loading
|
|
443
|
+
|
|
444
|
+
5. **Column Customization**: Customize columns after the grid loads to ensure proper initialization
|
|
445
|
+
|
|
446
|
+
## Module Exports
|
|
447
|
+
|
|
448
|
+
The package exports:
|
|
449
|
+
- `UserViewGridModule` - The Angular module to import
|
|
450
|
+
- `UserViewGridComponent` - The grid component
|
|
451
|
+
- `GridRowClickedEvent` - Type for row click events
|
|
452
|
+
- `GridRowEditedEvent` - Type for row edit events
|
|
453
|
+
- `GridPendingRecordItem` - Type for pending records
|
|
454
|
+
|
|
455
|
+
## Support
|
|
456
|
+
|
|
457
|
+
For issues or questions:
|
|
458
|
+
- Check the [MemberJunction documentation](https://docs.memberjunction.com)
|
|
459
|
+
- Submit issues to the [GitHub repository](https://github.com/MemberJunction/MJ)
|
|
460
|
+
- Contact MemberJunction support
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-user-view-grid",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.44.0",
|
|
4
4
|
"description": "MemberJunction: Angular Grid to display dynamic and saved user views for any entity in MemberJunction.",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"@angular/router": "18.0.2"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@memberjunction/global": "2.
|
|
29
|
-
"@memberjunction/core": "2.
|
|
30
|
-
"@memberjunction/core-entities": "2.
|
|
31
|
-
"@memberjunction/entity-communications-client": "2.
|
|
32
|
-
"@memberjunction/communication-types": "2.
|
|
33
|
-
"@memberjunction/templates-base-types": "2.
|
|
34
|
-
"@memberjunction/actions-base": "2.
|
|
35
|
-
"@memberjunction/ng-shared": "2.
|
|
36
|
-
"@memberjunction/ng-entity-form-dialog": "2.
|
|
37
|
-
"@memberjunction/ng-compare-records": "2.
|
|
38
|
-
"@memberjunction/ng-container-directives": "2.
|
|
39
|
-
"@memberjunction/ng-entity-communications": "2.
|
|
40
|
-
"@memberjunction/ng-base-types": "2.
|
|
28
|
+
"@memberjunction/global": "2.44.0",
|
|
29
|
+
"@memberjunction/core": "2.44.0",
|
|
30
|
+
"@memberjunction/core-entities": "2.44.0",
|
|
31
|
+
"@memberjunction/entity-communications-client": "2.44.0",
|
|
32
|
+
"@memberjunction/communication-types": "2.44.0",
|
|
33
|
+
"@memberjunction/templates-base-types": "2.44.0",
|
|
34
|
+
"@memberjunction/actions-base": "2.44.0",
|
|
35
|
+
"@memberjunction/ng-shared": "2.44.0",
|
|
36
|
+
"@memberjunction/ng-entity-form-dialog": "2.44.0",
|
|
37
|
+
"@memberjunction/ng-compare-records": "2.44.0",
|
|
38
|
+
"@memberjunction/ng-container-directives": "2.44.0",
|
|
39
|
+
"@memberjunction/ng-entity-communications": "2.44.0",
|
|
40
|
+
"@memberjunction/ng-base-types": "2.44.0",
|
|
41
41
|
"@progress/kendo-angular-grid": "16.2.0",
|
|
42
42
|
"@progress/kendo-angular-layout": "16.2.0",
|
|
43
43
|
"@progress/kendo-angular-inputs": "16.2.0",
|