-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsmart-webcomponents-angular-grid.js
3103 lines (3096 loc) · 138 KB
/
smart-webcomponents-angular-grid.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
if (!window['Smart']) {
window['Smart'] = { RenderMode: 'manual' };
}
else {
window['Smart'].RenderMode = 'manual';
}
import './../source/modules/smart.grid';
import { __decorate, __awaiter } from 'tslib';
import { EventEmitter, Output, Input, ElementRef, Directive, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
class BaseElement {
constructor(ref) {
this.onCreate = new EventEmitter();
this.onReady = new EventEmitter();
this.onAttach = new EventEmitter();
this.onDetach = new EventEmitter();
const that = this;
this.nativeElement = ref.nativeElement;
that.nativeElement.onAttached = () => {
that.onAttach.emit(that.nativeElement);
};
that.nativeElement.onDetached = () => {
that.onDetach.emit(that.nativeElement);
};
}
addEventListener(type, listener, options = false) {
this.nativeElement.addEventListener(type, listener, options);
}
removeEventListener(type, listener, options = false) {
this.nativeElement.removeEventListener(type, listener, options);
}
dispatchEvent(event) {
return this.nativeElement.dispatchEvent(event);
}
blur() {
this.nativeElement.blur();
}
click() {
this.nativeElement.click();
}
focus(options) {
this.nativeElement.focus(options);
}
/** @description Sets or gets the language. Used in conjunction with the property messages. */
get locale() {
return this.nativeElement ? this.nativeElement.locale : undefined;
}
set locale(value) {
this.nativeElement ? this.nativeElement.locale = value : undefined;
}
/** @description Callback used to customize the format of the messages that are returned from the Localization Module. */
get localizeFormatFunction() {
return this.nativeElement ? this.nativeElement.localizeFormatFunction : undefined;
}
set localizeFormatFunction(value) {
this.nativeElement ? this.nativeElement.localizeFormatFunction = value : undefined;
}
/** @description Sets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale. */
get messages() {
return this.nativeElement ? this.nativeElement.messages : undefined;
}
set messages(value) {
this.nativeElement ? this.nativeElement.messages = value : undefined;
}
/** @description Sets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts. */
get rightToLeft() {
return this.nativeElement ? this.nativeElement.rightToLeft : undefined;
}
set rightToLeft(value) {
this.nativeElement ? this.nativeElement.rightToLeft = value : undefined;
}
/** @description Determines the theme. Theme defines the look of the element */
get theme() {
return this.nativeElement ? this.nativeElement.theme : undefined;
}
set theme(value) {
this.nativeElement ? this.nativeElement.theme = value : undefined;
}
}
__decorate([
Output()
], BaseElement.prototype, "onCreate", void 0);
__decorate([
Output()
], BaseElement.prototype, "onReady", void 0);
__decorate([
Output()
], BaseElement.prototype, "onAttach", void 0);
__decorate([
Output()
], BaseElement.prototype, "onDetach", void 0);
__decorate([
Input()
], BaseElement.prototype, "locale", null);
__decorate([
Input()
], BaseElement.prototype, "localizeFormatFunction", null);
__decorate([
Input()
], BaseElement.prototype, "messages", null);
__decorate([
Input()
], BaseElement.prototype, "rightToLeft", null);
__decorate([
Input()
], BaseElement.prototype, "theme", null);
const Smart = window.Smart;
let GridComponent = class GridComponent extends BaseElement {
constructor(ref) {
super(ref);
this.eventHandlers = [];
/** @description This event is triggered, when the edit begins. After the event occurs, editing starts. If you need to prevent the editing for specific cells, rows or columns, you can call event.preventDefault();.
* @param event. The custom event. Custom event was created with: event.detail( id, dataField, row, column, cell, data, value)
* id - The edited row id.
* dataField - The edited column data field.
* row - The edited row.
* column - The edited column.
* cell - The edited cell.
* data - The edited row's data.
* value - The edited cell's value.
*/
this.onBeginEdit = new EventEmitter();
/** @description This event is triggered, when the Grid's header toolbar is displayed and the 'OK' button of a header dropdown is clicked. For example, when you open the columns customize panel, reorder columns and click the 'OK' button.
* @param event. The custom event. Custom event was created with: event.detail( type)
* type - The type of dropdown. Possible values: 'filter', 'sort', 'search', 'group', 'format', 'customize'
*/
this.onBatchChange = new EventEmitter();
/** @description This event is triggered, when the Grid's header toolbar is displayed and the 'Cancel' button of a header dropdown is clicked.
* @param event. The custom event. Custom event was created with: event.detail( type)
* type - The type of dropdown. Possible values: 'filter', 'sort', 'search', 'group', 'format', 'customize'
*/
this.onBatchCancel = new EventEmitter();
/** @description This event is triggered, when the selection is changed. When you select with a drag, the event is triggered when the drag starts and ends.
* @param event. The custom event. Custom event was created with: event.detail( started, finished, originalEvent)
* started - The flag is <em>true</em>, when the selection starts. The flag is <em>false</em>, when the selection ends and when the user changes the selection by dragging.
* finished - The flag is <em>true</em>, when the selection ends. The flag is <em>false</em>, when the selection starts and when the user changes the selection by dragging.
* originalEvent - The original event object, which is 'pointer', 'touch' or 'mouse' Event object, depending on the device type and web browser
*/
this.onChange = new EventEmitter();
/** @description This event is triggered, when the user clicks on the header of a column.
* @param event. The custom event. Custom event was created with: event.detail( column, dataField, originalEvent)
* column - The clicked column.
* dataField - The column's data field.
* originalEvent - The original event object, which is 'pointer', 'touch' or 'mouse' Event object, depending on the device type and web browser
*/
this.onColumnClick = new EventEmitter();
/** @description This event is triggered, when the user double clicks on the header of a column.
* @param event. The custom event. Custom event was created with: event.detail( column, dataField, originalEvent)
* column - The double-clicked column.
* dataField - The column's data field.
* originalEvent - The original event object, which is 'pointer', 'touch' or 'mouse' Event object, depending on the device type and web browser
*/
this.onColumnDoubleClick = new EventEmitter();
/** @description This event is triggered, when the user resized a column.
* @param event. The custom event. Custom event was created with: event.detail( column, dataField, oldWidth, width)
* column - The resized column.
* dataField - The column's data field.
* oldWidth - The old width of the column.
* width - The new width of the column.
*/
this.onColumnResize = new EventEmitter();
/** @description This event is triggered, when the user starts a column drag.
* @param event. The custom event. Custom event was created with: event.detail( column, dataField, index, originalEvent)
* column - The column.
* dataField - The column's data field.
* index - The column's index
* originalEvent - The origianl Event object.
*/
this.onColumnDragStart = new EventEmitter();
/** @description This event is triggered, when the user drags a column.
* @param event. The custom event. Custom event was created with: event.detail( column, dataField, index, data, originalEvent)
* column - The column.
* dataField - The column's data field.
* index - The column's index
* data - The dragging object. data.feedback and data.feedbackLine are HTML Elements which are displayed while the user drags. The object has error(), success() and data() methods which you can call to set the feedback state.
* originalEvent - The origianl Event object.
*/
this.onColumnDragging = new EventEmitter();
/** @description This event is triggered, when the user drops a column.
* @param event. The custom event. Custom event was created with: event.detail( column, dataField, index, newIndex, data, originalEvent)
* column - The column.
* dataField - The column's data field.
* index - The column's index
* newIndex - The column's new index
* data - The dragging object. data.feedback and data.feedbackLine are HTML Elements which are displayed while the user drags. The object has error(), success() and data() methods which you can call to set the feedback state.
* originalEvent - The origianl Event object.
*/
this.onColumnDragEnd = new EventEmitter();
/** @description This event is triggered, when the user reorders a column.
* @param event. The custom event. Custom event was created with: event.detail( column, dataField, index, newIndex, data, originalEvent)
* column - The column.
* dataField - The column's data field.
* index - The column's index
* newIndex - The column's new index
* data - The dragging object. data.feedback and data.feedbackLine are HTML Elements which are displayed while the user drags. The object has error(), success() and data() methods which you can call to set the feedback state.
* originalEvent - The origianl Event object.
*/
this.onColumnReorder = new EventEmitter();
/** @description This event is triggered, when the user enters a comment in the row edit dialog.
* @param event. The custom event. Custom event was created with: event.detail( id, comment)
* id - The row's id.
* comment - The comment object. The comment object has 'text: string', 'id: string', 'userId: string | number', and 'time: date' fields. The 'text' is the comment's text. 'id' is the comment's unique id, 'userId' is the user's id who entered the comment and 'time' is a javascript date object.
*/
this.onCommentAdd = new EventEmitter();
/** @description This event is triggered, when the user removes a comment in the row edit dialog.
* @param event. The custom event. Custom event was created with: event.detail( id, comment)
* id - The row's id.
* comment - The comment object. The comment object has 'text: string', 'id: string', 'userId: string | number', and 'time: date' fields. The 'text' is the comment's text. 'id' is the comment's unique id, 'userId' is the user's id who entered the comment and 'time' is a javascript date object.
*/
this.onCommentRemove = new EventEmitter();
/** @description This event is triggered, when the user clicks on a context menu item.
* @param event. The custom event. Custom event was created with: event.detail( id, dataField, command)
* id - The row's id.
* dataField - The column's data field.
* command - Command function.
*/
this.onContextMenuItemClick = new EventEmitter();
/** @description This event is triggered, when the user starts a row drag.
* @param event. The custom event. Custom event was created with: event.detail( row, id, index, originalEvent)
* row - The row.
* id - The row's id
* index - The row's index
* originalEvent - The origianl Event object.
*/
this.onRowDragStart = new EventEmitter();
/** @description This event is triggered, when the user drags a row.
* @param event. The custom event. Custom event was created with: event.detail( row, id, index, data, originalEvent)
* row - The row.
* id - The row's id
* index - The row's index
* data - The dragging object. data.feedback and data.feedbackLine are HTML Elements which are displayed while the user drags. The object has error(), success() and data() methods which you can call to set the feedback state.
* originalEvent - The origianl Event object.
*/
this.onRowDragging = new EventEmitter();
/** @description This event is triggered, when the user drags a row.
* @param event. The custom event. Custom event was created with: event.detail( row, id, index, newIndex, data, originalEvent)
* row - The row.
* id - The row's id
* index - The row's index
* newIndex - The row's new index
* data - The dragging object. data.feedback and data.feedbackLine are HTML Elements which are displayed while the user drags. The object has error(), success() and data() methods which you can call to set the feedback state.
* originalEvent - The origianl Event object.
*/
this.onRowDragEnd = new EventEmitter();
/** @description This event is triggered, when the user reorders a row.
* @param event. The custom event. Custom event was created with: event.detail( row, id, index, newIndex, data, originalEvent)
* row - The row.
* id - The row's id
* index - The row's index
* newIndex - The row's new index
* data - The dragging object. data.feedback and data.feedbackLine are HTML Elements which are displayed while the user drags. The object has error(), success() and data() methods which you can call to set the feedback state.
* originalEvent - The origianl Event object.
*/
this.onRowReorder = new EventEmitter();
/** @description This event is triggered, when the user expands a row of the grid. The Grid is in TreeGrid/Grouping mode.
* @param event. The custom event. Custom event was created with: event.detail( row, id, originalEvent)
* row - The expanded row.
* id - The row's id
* originalEvent - The original event object, which is 'pointer', 'touch' or 'mouse' Event object, depending on the device type and web browser
*/
this.onRowExpand = new EventEmitter();
/** @description This event is triggered, when the user collapsed a row of the grid. The Grid is in TreeGrid/Grouping mode.
* @param event. The custom event. Custom event was created with: event.detail( row, id, originalEvent)
* row - The collapsed row.
* id - The row's id
* originalEvent - The original event object, which is 'pointer', 'touch' or 'mouse' Event object, depending on the device type and web browser
*/
this.onRowCollapse = new EventEmitter();
/** @description This event is triggered, when the user clicks on a row of the grid.
* @param event. The custom event. Custom event was created with: event.detail( row, originalEvent, id, isRightClick, pageX, pageY)
* row - The clicked row.
* originalEvent - The original event object, which is 'pointer', 'touch' or 'mouse' Event object, depending on the device type and web browser
* id - Gets the row id.
* isRightClick - Gets whether the pointing device's right button is clicked.
* pageX - Gets the click's X position.
* pageY - Gets the click's Y position.
*/
this.onRowClick = new EventEmitter();
/** @description This event is triggered, when the user double clicks on a row of the grid.
* @param event. The custom event. Custom event was created with: event.detail( row, originalEvent, id, isRightClick, pageX, pageY)
* row - The double-clicked row.
* originalEvent - The original event object, which is 'pointer', 'touch' or 'mouse' Event object, depending on the device type and web browser
* id - Gets the row id.
* isRightClick - Gets whether the pointing device's right button is clicked.
* pageX - Gets the click's X position.
* pageY - Gets the click's Y position.
*/
this.onRowDoubleClick = new EventEmitter();
/** @description This event is triggered, when the user resized a row.
* @param event. The custom event. Custom event was created with: event.detail( row, id, oldHeight, height)
* row - The resized row.
* id - Gets the row id.
* oldHeight - The old height of the row.
* height - The new height of the row.
*/
this.onRowResize = new EventEmitter();
/** @description This event is triggered, when the user clicks on the row header's star.
* @param event. The custom event. Custom event was created with: event.detail( row, originalEvent, id, value)
* row - The clicked row.
* originalEvent - The original event object, which is 'pointer', 'touch' or 'mouse' Event object, depending on the device type and web browser
* id - Gets the row id.
* value - Gets whether the row is starred or not.
*/
this.onRowStarred = new EventEmitter();
/** @description This event is triggered, when the user clicks on a cell of the grid.
* @param event. The custom event. Custom event was created with: event.detail( cell, originalEvent, id, dataField, isRightClick, pageX, pageY)
* cell - The clicked cell.
* originalEvent - The original event object, which is 'pointer', 'touch' or 'mouse' Event object, depending on the device type and web browser
* id - Gets the row id.
* dataField - Gets the column dataField.
* isRightClick - Gets whether the pointing device's right button is clicked.
* pageX - Gets the click's X position.
* pageY - Gets the click's Y position.
*/
this.onCellClick = new EventEmitter();
/** @description This event is triggered, when the user double clicks on a cell of the grid.
* @param event. The custom event. Custom event was created with: event.detail( cell, originalEvent, id, dataField, isRightClick, pageX, pageY)
* cell - The double-clicked cell.
* originalEvent - The original event object, which is 'pointer', 'touch' or 'mouse' Event object, depending on the device type and web browser
* id - Gets the row id.
* dataField - Gets the column dataField.
* isRightClick - Gets whether the pointing device's right button is clicked.
* pageX - Gets the click's X position.
* pageY - Gets the click's Y position.
*/
this.onCellDoubleClick = new EventEmitter();
/** @description This event is triggered, when the edit ends.
* @param event. The custom event. Custom event was created with: event.detail( id, dataField, row, column, cell, data, value)
* id - The edited row id.
* dataField - The edited column data field.
* row - The edited row.
* column - The edited column.
* cell - The edited cell.
* data - The edited row's data.
* value - The edited cell's value.
*/
this.onEndEdit = new EventEmitter();
/** @description This event is triggered, when a filter is added or removed.
* @param event. The custom event. Custom event was created with: event.detail( columns, data, expressions)
* columns - Array of columns.
* data - Array of {dataField: string, filter: object}. <em>dataField</em> is the column's data field. <em>filter</em> is a FilterGroup object.
* expressions - Array of {dataField: string, filter: string}. <em>dataField</em> is the column's data field. <em>filter</em> is a filter expression like 'startsWith B'. In each array item, you will have an object with column's name and filter string. Example: [['firstName', 'contains Andrew or contains Nancy'], ['quantity', '<= 3 and >= 8']], [['firstName', 'EQUAL' 'Andrew' or 'EQUAL' 'Antoni' or 'EQUAL' 'Beate']], [['lastName','CONTAINS' 'burke' or 'CONTAINS' 'peterson']]. Filter conditions used in the filter expressions: '=', 'EQUAL','<>', 'NOT_EQUAL', '!=', '<', 'LESS_THAN','>', 'GREATER_THAN', '<=', 'LESS_THAN_OR_EQUAL', '>=', 'GREATER_THAN_OR_EQUAL','starts with', 'STARTS_WITH','ends with', 'ENDS_WITH', '', 'EMPTY', 'CONTAINS','DOES_NOT_CONTAIN', 'NULL','NOT_NULL'
*/
this.onFilter = new EventEmitter();
/** @description This event is triggered, when the rows grouping is changed.
* @param event. The custom event. Custom event was created with: event.detail( groups)
* groups - Array of column data fields.
*/
this.onGroup = new EventEmitter();
/** @description This event is triggered, when the add new column dialog is opened.
* @param event. The custom event. Custom event was created with: event.detail( dataField)
* dataField - The column data field.
*/
this.onOpenColumnDialog = new EventEmitter();
/** @description This event is triggered, when the add new column dialog is closed.
* @param event. The custom event. Custom event was created with: event.detail( dataField)
* dataField - The column data field.
*/
this.onCloseColumnDialog = new EventEmitter();
/** @description This event is triggered, when the grid is resized.
* @param event. The custom event. */
this.onResize = new EventEmitter();
/** @description This event is triggered when the user touches and holds on the row for at least 300ms.
* @param event. The custom event. Custom event was created with: event.detail( row, originalEvent)
* row - The tapped row.
* originalEvent - The original event object, which is 'pointer', 'touch' or 'mouse' Event object, depending on the device type and web browser
*/
this.onRowTap = new EventEmitter();
/** @description This event is triggered when the user touches and holds on the cell for at least 300ms.
* @param event. The custom event. Custom event was created with: event.detail( cell, originalEvent)
* cell - The tapped row.
* originalEvent - The original event object, which is 'pointer', 'touch' or 'mouse' Event object, depending on the device type and web browser
*/
this.onCellTap = new EventEmitter();
/** @description This event is triggered, when the user changes the pages.
* @param event. The custom event. */
this.onPage = new EventEmitter();
/** @description This event is triggered, when a sorting column is added or removed.
* @param event. The custom event. Custom event was created with: event.detail( columns, data, sortDataFields, sortDataTypes, sortOrders, sortIndexes)
* columns - Array of columns.
* data - Array of {dataField: string, sortOrder: string, sortIndex: number}. <em>dataField</em> is the column's data field. <em>sortOrder</em> is 'asc' or 'desc', <em>sortIndex</em> is the index of the column in multi column sorting.
* sortDataFields - Array of column data fields.
* sortDataTypes - Array of column data types. The values in the array would be 'string', 'date', 'boolean' or 'number'.
* sortOrders - Array of column orders. The values in the array would be 'asc' or 'desc'.
* sortIndexes - Array of column sort indexes. When multiple sorting is applied the sort index is an important parameter as it specifies the priority of sorting.
*/
this.onSort = new EventEmitter();
/** @description This event is triggered, when the user reaches the bottom of the grid.
* @param event. The custom event. */
this.onScrollBottomReached = new EventEmitter();
/** @description This event is triggered, when the user reaches the top of the grid.
* @param event. The custom event. */
this.onScrollTopReached = new EventEmitter();
this.nativeElement = ref.nativeElement;
}
/** @description Creates the component on demand.
* @param properties An optional object of properties, which will be added to the template binded ones.
*/
createComponent(properties = {}) {
this.nativeElement = document.createElement('smart-grid');
for (let propertyName in properties) {
this.nativeElement[propertyName] = properties[propertyName];
}
return this.nativeElement;
}
/** @description An object containing settings related to the grid's appearance. */
get appearance() {
return this.nativeElement ? this.nativeElement.appearance : undefined;
}
set appearance(value) {
this.nativeElement ? this.nativeElement.appearance = value : undefined;
}
/** @description An object containing settings related to the grid's behavior. */
get behavior() {
return this.nativeElement ? this.nativeElement.behavior : undefined;
}
set behavior(value) {
this.nativeElement ? this.nativeElement.behavior = value : undefined;
}
/** @description An object containing settings related to the grid's layout. */
get layout() {
return this.nativeElement ? this.nativeElement.layout : undefined;
}
set layout(value) {
this.nativeElement ? this.nativeElement.layout = value : undefined;
}
/** @description Sets or gets the language. Used in conjunction with the property messages. */
get locale() {
return this.nativeElement ? this.nativeElement.locale : undefined;
}
set locale(value) {
this.nativeElement ? this.nativeElement.locale = value : undefined;
}
/** @description The clipboard property is used to enable/disable clipboard operations with Ctrl+C, Ctrl+X and Ctrl+V keyboard navigations.. */
get clipboard() {
return this.nativeElement ? this.nativeElement.clipboard : undefined;
}
set clipboard(value) {
this.nativeElement ? this.nativeElement.clipboard = value : undefined;
}
/** @description The columns property is used to describe all columns displayed in the grid. */
get columns() {
return this.nativeElement ? this.nativeElement.columns : undefined;
}
set columns(value) {
this.nativeElement ? this.nativeElement.columns = value : undefined;
}
/** @description Context Menu is the drop-down menu displayed after right-clicking a Grid row. It allows you to delete row, edit cell or row depending on the edit mode. The 'contextMenuItemCustom' dataSource option allows you to add custom menu item to the context menu. You can replace the context menu by using the 'selector' property and setting it to ID of a Smart.Menu component. */
get contextMenu() {
return this.nativeElement ? this.nativeElement.contextMenu : undefined;
}
set contextMenu(value) {
this.nativeElement ? this.nativeElement.contextMenu = value : undefined;
}
/** @description Column Menu is the drop-down menu displayed after clicking the column header's drop-down button, which is displayed when you hover the column header. It allows you to customize column settings. For example: Sort, Filter or Group the Grid by the current column. */
get columnMenu() {
return this.nativeElement ? this.nativeElement.columnMenu : undefined;
}
set columnMenu(value) {
this.nativeElement ? this.nativeElement.columnMenu = value : undefined;
}
/** @description Describes the settings of the column groups. */
get columnGroups() {
return this.nativeElement ? this.nativeElement.columnGroups : undefined;
}
set columnGroups(value) {
this.nativeElement ? this.nativeElement.columnGroups = value : undefined;
}
/** @description Sets or gets details about conditional formatting to be applied to the Grid's cells. */
get conditionalFormatting() {
return this.nativeElement ? this.nativeElement.conditionalFormatting : undefined;
}
set conditionalFormatting(value) {
this.nativeElement ? this.nativeElement.conditionalFormatting = value : undefined;
}
/** @description Sets the Grid Charting Data Visualization. */
get charting() {
return this.nativeElement ? this.nativeElement.charting : undefined;
}
set charting(value) {
this.nativeElement ? this.nativeElement.charting = value : undefined;
}
/** @description Sets the TreeGrid checkboxes. */
get checkBoxes() {
return this.nativeElement ? this.nativeElement.checkBoxes : undefined;
}
set checkBoxes(value) {
this.nativeElement ? this.nativeElement.checkBoxes = value : undefined;
}
/** @description Sets the Grid Data Export options. */
get dataExport() {
return this.nativeElement ? this.nativeElement.dataExport : undefined;
}
set dataExport(value) {
this.nativeElement ? this.nativeElement.dataExport = value : undefined;
}
/** @description Sets the grid's data source. The value of dataSource can be an instance of JQX.DataAdapter or an Array. */
get dataSource() {
return this.nativeElement ? this.nativeElement.dataSource : undefined;
}
set dataSource(value) {
this.nativeElement ? this.nativeElement.dataSource = value : undefined;
}
/** @description Sets the grid's data source settings when the dataSource property is set to an Array or URL. */
get dataSourceSettings() {
return this.nativeElement ? this.nativeElement.dataSourceSettings : undefined;
}
set dataSourceSettings(value) {
this.nativeElement ? this.nativeElement.dataSourceSettings = value : undefined;
}
/** @description Describes the grid's editing settings. */
get editing() {
return this.nativeElement ? this.nativeElement.editing : undefined;
}
set editing(value) {
this.nativeElement ? this.nativeElement.editing = value : undefined;
}
/** @description Describes the grid's filtering settings. */
get filtering() {
return this.nativeElement ? this.nativeElement.filtering : undefined;
}
set filtering(value) {
this.nativeElement ? this.nativeElement.filtering = value : undefined;
}
/** @description Describes the grid's grouping settings. */
get grouping() {
return this.nativeElement ? this.nativeElement.grouping : undefined;
}
set grouping(value) {
this.nativeElement ? this.nativeElement.grouping = value : undefined;
}
/** @description Sets the messages values. */
get messages() {
return this.nativeElement ? this.nativeElement.messages : undefined;
}
set messages(value) {
this.nativeElement ? this.nativeElement.messages = value : undefined;
}
/** @description Callback function(chart: JQX.Chart) called when the chart has been initialized. You can use this function to customize the Chart element settings. */
get onCellValue() {
return this.nativeElement ? this.nativeElement.onCellValue : undefined;
}
set onCellValue(value) {
this.nativeElement ? this.nativeElement.onCellValue = value : undefined;
}
/** @description Callback function() called when the grid has been rendered. */
get onCellUpdate() {
return this.nativeElement ? this.nativeElement.onCellUpdate : undefined;
}
set onCellUpdate(value) {
this.nativeElement ? this.nativeElement.onCellUpdate = value : undefined;
}
/** @description Callback function() called when the grid has been rendered for first time and bindings are completed. The component is ready. */
get onCellRender() {
return this.nativeElement ? this.nativeElement.onCellRender : undefined;
}
set onCellRender(value) {
this.nativeElement ? this.nativeElement.onCellRender = value : undefined;
}
/** @description Sets or gets the rows CSS class rules. Different CSS class names are conditionally applied. Example: rowCSSRules: { 'cell-class-1': settings => settings.data.quantity === 5, 'cell-class-2': settings => settings.data.quantity < 5, 'cell-class-3': settings => settings.data.quantity > 5 }. The settings object contains the following properties: index, data, row, api. */
get onBeforeInit() {
return this.nativeElement ? this.nativeElement.onBeforeInit : undefined;
}
set onBeforeInit(value) {
this.nativeElement ? this.nativeElement.onBeforeInit = value : undefined;
}
/** @description Sets or gets the id of the current user. Has to correspond to the id of an item from the users property/array. Depending on the current user, different privileges are enabled. If no current user is set, privileges depend on the element's properties. */
get onInit() {
return this.nativeElement ? this.nativeElement.onInit : undefined;
}
set onInit(value) {
this.nativeElement ? this.nativeElement.onInit = value : undefined;
}
/** @description Sets the grid users. Expects an array with 'id', 'name' and optionally 'color' and 'image' properties. */
get onAfterInit() {
return this.nativeElement ? this.nativeElement.onAfterInit : undefined;
}
set onAfterInit(value) {
this.nativeElement ? this.nativeElement.onAfterInit = value : undefined;
}
/** @description Sets the grid's image and filter upload settings for the image and attachment columns. */
get onChartInit() {
return this.nativeElement ? this.nativeElement.onChartInit : undefined;
}
set onChartInit(value) {
this.nativeElement ? this.nativeElement.onChartInit = value : undefined;
}
/** @description Describes the paging settings. */
get onRender() {
return this.nativeElement ? this.nativeElement.onRender : undefined;
}
set onRender(value) {
this.nativeElement ? this.nativeElement.onRender = value : undefined;
}
/** @description Describes the pager settings. */
get onLoad() {
return this.nativeElement ? this.nativeElement.onLoad : undefined;
}
set onLoad(value) {
this.nativeElement ? this.nativeElement.onLoad = value : undefined;
}
/** @description Sets the row details. */
get onKey() {
return this.nativeElement ? this.nativeElement.onKey : undefined;
}
set onKey(value) {
this.nativeElement ? this.nativeElement.onKey = value : undefined;
}
/** @description Sets the scroll mode settings. */
get onRowInit() {
return this.nativeElement ? this.nativeElement.onRowInit : undefined;
}
set onRowInit(value) {
this.nativeElement ? this.nativeElement.onRowInit = value : undefined;
}
/** @description Describes the column header settings. */
get onRowDetailInit() {
return this.nativeElement ? this.nativeElement.onRowDetailInit : undefined;
}
set onRowDetailInit(value) {
this.nativeElement ? this.nativeElement.onRowDetailInit = value : undefined;
}
/** @description Describes the summary row settings. */
get onRowDetailUpdated() {
return this.nativeElement ? this.nativeElement.onRowDetailUpdated : undefined;
}
set onRowDetailUpdated(value) {
this.nativeElement ? this.nativeElement.onRowDetailUpdated = value : undefined;
}
/** @description Sets the grid's state settings. */
get onRowHistory() {
return this.nativeElement ? this.nativeElement.onRowHistory : undefined;
}
set onRowHistory(value) {
this.nativeElement ? this.nativeElement.onRowHistory = value : undefined;
}
/** @description Describes the settings for the group header. */
get onRowStyle() {
return this.nativeElement ? this.nativeElement.onRowStyle : undefined;
}
set onRowStyle(value) {
this.nativeElement ? this.nativeElement.onRowStyle = value : undefined;
}
/** @description Describes the header settings of the grid. */
get onRowInserted() {
return this.nativeElement ? this.nativeElement.onRowInserted : undefined;
}
set onRowInserted(value) {
this.nativeElement ? this.nativeElement.onRowInserted = value : undefined;
}
/** @description Describes the footer settings of the grid. */
get onRowRemoved() {
return this.nativeElement ? this.nativeElement.onRowRemoved : undefined;
}
set onRowRemoved(value) {
this.nativeElement ? this.nativeElement.onRowRemoved = value : undefined;
}
/** @description Sets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts. */
get onRowUpdate() {
return this.nativeElement ? this.nativeElement.onRowUpdate : undefined;
}
set onRowUpdate(value) {
this.nativeElement ? this.nativeElement.onRowUpdate = value : undefined;
}
/** @description The rows property is used to describe all rows displayed in the grid. */
get onRowUpdated() {
return this.nativeElement ? this.nativeElement.onRowUpdated : undefined;
}
set onRowUpdated(value) {
this.nativeElement ? this.nativeElement.onRowUpdated = value : undefined;
}
/** @description Describes the selection settings. */
get onRowClass() {
return this.nativeElement ? this.nativeElement.onRowClass : undefined;
}
set onRowClass(value) {
this.nativeElement ? this.nativeElement.onRowClass = value : undefined;
}
/** @description Describes sorting settings. */
get onCellClass() {
return this.nativeElement ? this.nativeElement.onCellClass : undefined;
}
set onCellClass(value) {
this.nativeElement ? this.nativeElement.onCellClass = value : undefined;
}
/** @description undefined */
get onColumnInit() {
return this.nativeElement ? this.nativeElement.onColumnInit : undefined;
}
set onColumnInit(value) {
this.nativeElement ? this.nativeElement.onColumnInit = value : undefined;
}
/** @description undefined */
get onColumnInserted() {
return this.nativeElement ? this.nativeElement.onColumnInserted : undefined;
}
set onColumnInserted(value) {
this.nativeElement ? this.nativeElement.onColumnInserted = value : undefined;
}
/** @description undefined */
get onColumnRemoved() {
return this.nativeElement ? this.nativeElement.onColumnRemoved : undefined;
}
set onColumnRemoved(value) {
this.nativeElement ? this.nativeElement.onColumnRemoved = value : undefined;
}
/** @description undefined */
get onColumnUpdated() {
return this.nativeElement ? this.nativeElement.onColumnUpdated : undefined;
}
set onColumnUpdated(value) {
this.nativeElement ? this.nativeElement.onColumnUpdated = value : undefined;
}
/** @description undefined */
get onColumnClone() {
return this.nativeElement ? this.nativeElement.onColumnClone : undefined;
}
set onColumnClone(value) {
this.nativeElement ? this.nativeElement.onColumnClone = value : undefined;
}
/** @description undefined */
get onCommand() {
return this.nativeElement ? this.nativeElement.onCommand : undefined;
}
set onCommand(value) {
this.nativeElement ? this.nativeElement.onCommand = value : undefined;
}
/** @description undefined */
get rowCSSRules() {
return this.nativeElement ? this.nativeElement.rowCSSRules : undefined;
}
set rowCSSRules(value) {
this.nativeElement ? this.nativeElement.rowCSSRules = value : undefined;
}
/** @description undefined */
get currentUser() {
return this.nativeElement ? this.nativeElement.currentUser : undefined;
}
set currentUser(value) {
this.nativeElement ? this.nativeElement.currentUser = value : undefined;
}
/** @description undefined */
get users() {
return this.nativeElement ? this.nativeElement.users : undefined;
}
set users(value) {
this.nativeElement ? this.nativeElement.users = value : undefined;
}
/** @description undefined */
get uploadSettings() {
return this.nativeElement ? this.nativeElement.uploadSettings : undefined;
}
set uploadSettings(value) {
this.nativeElement ? this.nativeElement.uploadSettings = value : undefined;
}
/** @description undefined */
get paging() {
return this.nativeElement ? this.nativeElement.paging : undefined;
}
set paging(value) {
this.nativeElement ? this.nativeElement.paging = value : undefined;
}
/** @description undefined */
get pager() {
return this.nativeElement ? this.nativeElement.pager : undefined;
}
set pager(value) {
this.nativeElement ? this.nativeElement.pager = value : undefined;
}
/** @description undefined */
get rowDetail() {
return this.nativeElement ? this.nativeElement.rowDetail : undefined;
}
set rowDetail(value) {
this.nativeElement ? this.nativeElement.rowDetail = value : undefined;
}
/** @description undefined */
get scrolling() {
return this.nativeElement ? this.nativeElement.scrolling : undefined;
}
set scrolling(value) {
this.nativeElement ? this.nativeElement.scrolling = value : undefined;
}
/** @description undefined */
get columnHeader() {
return this.nativeElement ? this.nativeElement.columnHeader : undefined;
}
set columnHeader(value) {
this.nativeElement ? this.nativeElement.columnHeader = value : undefined;
}
/** @description undefined */
get summaryRow() {
return this.nativeElement ? this.nativeElement.summaryRow : undefined;
}
set summaryRow(value) {
this.nativeElement ? this.nativeElement.summaryRow = value : undefined;
}
/** @description undefined */
get stateSettings() {
return this.nativeElement ? this.nativeElement.stateSettings : undefined;
}
set stateSettings(value) {
this.nativeElement ? this.nativeElement.stateSettings = value : undefined;
}
/** @description undefined */
get groupHeader() {
return this.nativeElement ? this.nativeElement.groupHeader : undefined;
}
set groupHeader(value) {
this.nativeElement ? this.nativeElement.groupHeader = value : undefined;
}
/** @description undefined */
get header() {
return this.nativeElement ? this.nativeElement.header : undefined;
}
set header(value) {
this.nativeElement ? this.nativeElement.header = value : undefined;
}
/** @description undefined */
get footer() {
return this.nativeElement ? this.nativeElement.footer : undefined;
}
set footer(value) {
this.nativeElement ? this.nativeElement.footer = value : undefined;
}
/** @description undefined */
get rightToLeft() {
return this.nativeElement ? this.nativeElement.rightToLeft : undefined;
}
set rightToLeft(value) {
this.nativeElement ? this.nativeElement.rightToLeft = value : undefined;
}
/** @description undefined */
get rows() {
return this.nativeElement ? this.nativeElement.rows : undefined;
}
set rows(value) {
this.nativeElement ? this.nativeElement.rows = value : undefined;
}
/** @description undefined */
get selection() {
return this.nativeElement ? this.nativeElement.selection : undefined;
}
set selection(value) {
this.nativeElement ? this.nativeElement.selection = value : undefined;
}
/** @description undefined */
get sorting() {
return this.nativeElement ? this.nativeElement.sorting : undefined;
}
set sorting(value) {
this.nativeElement ? this.nativeElement.sorting = value : undefined;
}
/** @description Adds a row. When batch editing is enabled, the row is not saved until the batch edit is saved.
* @param {any} data. row data matching the data source
* @param {boolean} insertAtBottom?. Determines whether to add the new row to the bottom or top of the collection. The default value is 'true'
* @param {{(row: GridRow): void}} callback?. Sets a callback function, which is called after the new row is added. The callback's argument is the new row.
*/
addRow(data, insertAtBottom, callback) {
if (this.nativeElement.isRendered) {
this.nativeElement.addRow(data, insertAtBottom, callback);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.addRow(data, insertAtBottom, callback);
});
}
}
/** @description Adds a new row and puts it into edit mode. When batch editing is enabled, the row is not saved until the batch edit is saved.
* @param {string} position?. 'near' or 'far'
* @returns {boolean}
*/
addNewRow(position) {
return __awaiter(this, void 0, void 0, function* () {
const getResultOnRender = () => {
return new Promise(resolve => {
this.nativeElement.whenRendered(() => {
const result = this.nativeElement.addNewRow(position);
resolve(result);
});
});
};
const result = yield getResultOnRender();
return result;
});
}
/** @description Adds a new column.
* @param {any} column. A Grid column object. See 'columns' property.
* @returns {boolean}
*/
addNewColumn(column) {
return __awaiter(this, void 0, void 0, function* () {
const getResultOnRender = () => {
return new Promise(resolve => {
this.nativeElement.whenRendered(() => {
const result = this.nativeElement.addNewColumn(column);
resolve(result);
});
});
};
const result = yield getResultOnRender();
return result;
});
}
/** @description Adds a new unbound row to the top or bottom. Unbound rows are not part of the Grid's dataSource. They become part of the dataSource, after an unbound row is edited.
* @param {number} count. The count of unbound rows.
* @param {string} position?. 'near' or 'far'
* @returns {boolean}
*/
addUnboundRow(count, position) {
return __awaiter(this, void 0, void 0, function* () {
const getResultOnRender = () => {
return new Promise(resolve => {
this.nativeElement.whenRendered(() => {
const result = this.nativeElement.addUnboundRow(count, position);
resolve(result);
});
});
};
const result = yield getResultOnRender();
return result;
});
}
/** @description Adds a filter to a column. This method will apply a filter to the Grid data. Example for adding multiple filters to a column: grid.addFilter('lastName', ['CONTAINS "burke"', 'or', 'CONTAINS "peterson"']). Example for adding single filter to a column: grid.addFilter('lastName', 'CONTAINS "burke"'). Example for adding numeric filter: grid.addFilter('quantity', '<= 5')
* @param {string} dataField. column bound data field. For example, if you have a column with dataField: 'firstName', set 'firstName' here.
* @param {string} filter. Filter expression like: 'startsWith B'. Example 2: ['contains Andrew or contains Nancy'], Example 3: ['quantity', '<= 3 and >= 8']. Filter conditions which you can use in the expressions: '=', 'EQUAL','<>', 'NOT_EQUAL', '!=', '<', 'LESS_THAN','>', 'GREATER_THAN', '<=', 'LESS_THAN_OR_EQUAL', '>=', 'GREATER_THAN_OR_EQUAL','starts with', 'STARTS_WITH','ends with', 'ENDS_WITH', '', 'EMPTY', 'CONTAINS','DOES_NOT_CONTAIN', 'NULL','NOT_NULL'
* @param {boolean} refreshFilters?. Set this to false, if you will use multiple 'addFilter' calls. By doing this, you will avoid unnecessary renders.
*/
addFilter(dataField, filter, refreshFilters) {
if (this.nativeElement.isRendered) {
this.nativeElement.addFilter(dataField, filter, refreshFilters);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.addFilter(dataField, filter, refreshFilters);
});
}
}
/** @description Groups the Grid by a data field. This method will add a group to the Grid when grouping is enabled.
* @param {string} dataField. column bound data field. For example, if you have a column with dataField: 'firstName', set 'firstName' here.
*/
addGroup(dataField) {
if (this.nativeElement.isRendered) {
this.nativeElement.addGroup(dataField);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.addGroup(dataField);
});
}
}
/** @description Sorts the Grid by a data field. This method will add a sorting to the Grid when sorting is enabled.
* @param {string} dataField. column bound data field. For example, if you have a column with dataField: 'firstName', set 'firstName' here.
* @param {string} sortOrder. column's sort order. Use 'asc' or 'desc'.
*/
addSort(dataField, sortOrder) {
if (this.nativeElement.isRendered) {
this.nativeElement.addSort(dataField, sortOrder);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.addSort(dataField, sortOrder);
});
}
}
/** @description Auto-sizes grid rows. This method will update the height of all Grid rows.
*/
autoSizeRows() {
if (this.nativeElement.isRendered) {
this.nativeElement.autoSizeRows();
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.autoSizeRows();
});
}
}
/** @description Auto-sizes grid columns. This method will update the width of all Grid columns.
*/
autoSizeColumns() {
if (this.nativeElement.isRendered) {
this.nativeElement.autoSizeColumns();
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.autoSizeColumns();
});
}
}
/** @description Auto-sizes grid column. This method will update the width of a Grid column by measuring the cells and column header label width.
* @param {string} dataField?. column bound data field. For example, if you have a column with dataField: 'firstName', set 'firstName' here.
*/
autoSizeColumn(dataField) {
if (this.nativeElement.isRendered) {
this.nativeElement.autoSizeColumn(dataField);
}
else {