-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathinfragistics.ui.combo.js
More file actions
7718 lines (6618 loc) · 253 KB
/
infragistics.ui.combo.js
File metadata and controls
7718 lines (6618 loc) · 253 KB
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
/*!@license
* Infragistics.Web.ClientUI Combo <build_number>
*
* Copyright (c) 2011-<year> Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery.js
* jquery.ui.core.js
* jquery.ui.widget.js
* infragistics.templating.js
* infragistics.util.js
* infragistics.util.jquery.js
* infragistics.dataSource.js
* infragistics.ui.widget.js
*
* Example to use:
* <script type="text/javascript">
* $(function () {
* $("#combo").igCombo();
* });
* </script>
* <input id="combo" />
*/
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {
// AMD. Register as an anonymous module.
define( [
"./infragistics.ui.widget",
"./infragistics.templating",
"./infragistics.datasource",
"./infragistics.ui.scroll",
"./infragistics.ui.validator"
], factory );
} else {
// Browser globals
return factory(jQuery);
}
}
(function ($) {
/*
igCombo is a widget based on jQuery UI that provides ability to edit text and show drop-down list.
Drop-down list supports multiple selection, filtering, templating, rendering matching items, active item, etc.
Editing of field supports auto-complete, editing multiple items, synchronization with selection in drop-down list, clear button, etc.
*/
$.widget("ui.igCombo", $.ui.igWidget, {
options: {
/* type="number|string" Gets/Sets the width of combo. The numeric and string values (valid html units for size) are supported. It includes %, px, em and other units.
```
//Initialize
$(".selector").igCombo({
width: "300px"
});
//Get
var width = $(".selector").igCombo("option", "width");
//Set
$(".selector").igCombo("option", "width", "300px");
```
string The default width can be set in pixels (px), %, em and other units.
number The default width can be set as a number.
*/
width: null,
/* type="number|string" Gets/Sets height of combo. The numeric and string values (valid html units for size) are supported. It includes %, px, em and other units.
```
//Initialize
$(".selector").igCombo({
height: "25px"
});
//Get
var height = $(".selector").igCombo("option", "height");
//Set
$(".selector").igCombo("option", "height", "25px");
```
string The default height can be set in pixels (px), %, em and other units.
number The default height can be set as a number.
*/
height: null,
/* type="number|string" Gets/Sets the width of drop-down list in pixels.
```
//Initialize
$(".selector").igCombo({
dropDownWidth: 200
});
//Get
var width = $(".selector").igCombo("option", "dropDownWidth");
//Set
$(".selector").igCombo("option", "dropDownWidth", 200);
```
string type="string" The default drop-down list width can be set in pixels (px).
number type="number" The default drop-down list width can be set as a number.
*/
dropDownWidth: null,
/* type="object" Gets/Sets a valid data source accepted by [$.ig.DataSource](ig.datasource), or an instance of an [$.ig.DataSource](ig.datasource) itself.
Note: if it is set to string and [dataSourceType](ui.igcombo#options:dataSourceType) option is not set, then [$.ig.JSONDataSource](ig.jsondatasource) is used.
```
//Initialize
$(".selector").igCombo({
dataSource: data
});
//Get
var data = $(".selector").igCombo("option", "dataSource");
//Set
$(".selector").igCombo("option", "dataSource", ds);
```
*/
dataSource: null,
/* type="string" Sets data source type (such as "json", "xml", etc). Please refer to the documentation of [$.ig.DataSource](ig.datasource) and its [type](ig.datasource#options:settings.type) property.
```
//Initialize
$(".selector").igCombo({
dataSourceType: "xml"
});
//Get
var dataType = $(".selector").igCombo("option", "dataSourceType");
```
*/
dataSourceType: null,
/* type="string" Sets URL which is used for sending JSON on request for remote filtering (MVC for example). That option is required when [load on demand](ui.igcombo#options:loadOnDemandSettings) is
[enabled](ui.igcombo#options:loadOnDemandSettings.enabled) and its [type](ui.igcombo#options:filteringType) is remote.
```
//Initialize
$(".selector").igCombo({
dataSourceUrl: "data.svc"
});
//Get
var dataUrl = $(".selector").igCombo("option", "dataSourceUrl");
```
*/
dataSourceUrl: null,
/* type="string" see [$.ig.DataSource](ig.datasource) property in the response specifying the total number of records on the server.
```
//Initialize
$(".selector").igCombo({
responseTotalRecCountKey: "count"
});
//Get
var countKey = $(".selector").igCombo("option", "responseTotalRecCountKey");
```
*/
responseTotalRecCountKey: null,
/* type="string" See [$.ig.DataSource](ig.datasource) This is basically the property in the response where data records are held, if the response is wrapped.
```
//Initialize
$(".selector").igCombo({
responseDataKey: "d.results"
});
//Get
var dataKey = $(".selector").igCombo("option", "responseDataKey");
```
*/
responseDataKey: null,
/*
type="json|xml|html|script|jsonp|text" Response type when a URL is set as the data source. See http://api.jquery.com/jQuery.ajax/ => dataType.
```
//Initialize
$(".selector").igCombo({
responseDataType: "text"
});
//Get
var responseDataType = $(".selector").igCombo("option", "responseDataType");
```
json type="string"
xml type="string"
html type="string"
script type="string"
jsonp type="string"
text type="string"
*/
responseDataType: null,
/* type="string" Content type of the response. See http://api.jquery.com/jQuery.ajax/ => contentType.
```
//Initialize
$(".selector").igCombo({
responseContentType: "application/json; charset=utf-8"
});
//Get
var responseContentType = $(".selector").igCombo("option", "responseContentType");
```
*/
responseContentType: null,
/* type="string" specifies the HTTP verb to be used to issue the request.
```
//Initialize
$(".selector").igCombo({
requestType: "get"
});
//Get
var requestType = $(".selector").igCombo("option", "requestType");
```
*/
requestType: "GET",
/* type="string" Gets/Sets name of column which contains the "value". If it is missing, then the name of first column will be used.
```
//Initialize
$(".selector").igCombo({
valueKey: "ProductID"
});
//Get
var key = $(".selector").igCombo("option", "valueKey");
```
*/
valueKey: null,
/* type="string" Gets/Sets name of column which contains the displayed text. If it is missing, then [valueKey](ui.igcombo#options:valueKey) option will be used.
```
//Initialize
$(".selector").igCombo({
textKey: "ProductName"
});
//Get
var key = $(".selector").igCombo("option", "textKey");
```*/
textKey: null,
/* type="string" Gets/Sets a template used to render an item in list. The igCombo utilizes igTemplating for generating node content templates.
More info on the templating engine can be found here: http://www.igniteui.com/help/infragistics-templating-engine.
```
//Initialize
$(".selector").igCombo({
itemTemplate: "<span class="movieTitle">${Name}</span><img src="${Url}" />"
});
//Get
var template = $(".selector").igCombo("option", "itemTemplate");
```
*/
itemTemplate: null,
/* type="string" Gets/Sets template used to render a header in the drop-down list. The template is rendered inside of a DIV html element.
```
//Initialize
$(".selector").igCombo({
headerTemplate: "<div class='dropDownHeaderFooter'>Available Products</div>"
});
//Get
var headerTemplate = $(".selector").igCombo("option", "headerTemplate");
//Set
$(".selector").igCombo("option", "headerTemplate", "<div class='dropDownHeaderClass'>Available Products</div>");
```
*/
headerTemplate: null,
/* type="string" Gets/Sets template used to render a footer in the drop-down list.
Notes:
1. The template is rendered inside of DIV html element.
2. The following variables can be used:
- {0}: Number of records in igCombo (view of dataSource)
- {1}: Number of records in dataSource
- {2}: Number of (filtered) records on server
- {3}: Number of all records on server
```
//Initialize
$(".selector").igCombo({
footerTemplate: "<div class='dropDownHeaderFooter'>Available Products</div>"
});
//Get
var footerTemplate = $(".selector").igCombo("option", "footerTemplate");
//Set
$(".selector").igCombo("option", "footerTemplate", "<div class='dropDownFooterClass'>Product Count: {0} / {3} {1}/ {2}</div>");
```
*/
footerTemplate: null,
/* type="string" Gets/Sets the name of a hidden INPUT element, which is used when submitting data. Its value will be set to the values of the selected items valueKeys separated by ',' character on any change in igCombo. If the combo element has 'name' attribute and this option is not set, the 'name' attribute will be used for the input name.
```
//Initialize
$(".selector").igCombo({
inputName: "textField"
});
//Get
var inputName = $(".selector").igCombo("option", "inputName");
//Set
$(".selector").igCombo("option", "inputName", "textField");
```
*/
inputName: null,
/* type="number" Gets/Sets show drop-down list animation duration in milliseconds.
```
//Initialize
$(".selector").igCombo({
animationShowDuration: 25
});
//Get
var animationDuration = $(".selector").igCombo("option", "animationShowDuration");
//Set
$(".selector").igCombo("option", "animationShowDuration", 25);
```
*/
animationShowDuration: 100,
/* type="number" Gets/Sets hide drop-down list animation duration in milliseconds.
```
//Initialize
$(".selector").igCombo({
animationHideDuration: 25
});
//Get
var animationDuration = $(".selector").igCombo("option", "animationHideDuration");
//Set
$(".selector").igCombo("option", "animationHideDuration", 25);
```
*/
animationHideDuration: 100,
/* type="bool" If set to true, the container of the drop-down list is appended to the body.
If set to false, it is appended to the parent element of the combo.
```
//Initialize
$(".selector").igCombo({
dropDownAttachedToBody: false
});
//Get
var dropDownAttachedToBody = $(".selector").igCombo("option", "dropDownAttachedToBody");
```
*/
dropDownAttachedToBody: true,
/* type="remote|local|none" Gets/Sets type of filtering.
Note: option is set to "remote", then the "css.waitFiltering" is applied to combo and its drop-down list.
```
//Initialize
$(".selector").igCombo({
filteringType: "remote"
});
//Get
var filterType = $(".selector").igCombo("option", "filteringType");
//Set
$(".selector").igCombo("option", "filteringType", "remote");
```
remote type="string" filtering is performed by server
local type="string" filtering is performed by $.ig.DataSource
none type="string" filtering is disabled
*/
filteringType: "local",
/* type="string" Gets/Sets URL key name that specifies how the remote filtering expressions will be encoded for remote requests, e.g. &filter('col') = startsWith. Default is OData.
```
//Initialize
$(".selector").igCombo({
filterExprUrlKey: "filter"
});
//Get
var filterKey = $(".selector").igCombo("option", "filterExprUrlKey");
//Set
$(".selector").igCombo("option", "filterExprUrlKey", "filter");
```
*/
filterExprUrlKey: null,
/* type="contains|doesNotContain|startsWith|endsWith|greaterThan|lessThan|greaterThanOrEqualTo|lessThanOrEqualTo|equals|doesNotEqual" Gets/Sets condition used for filtering.
Note: When [autoComplete](ui.igcombo#options:autoComplete) is enabled, the filtering condition is always "startsWith".
```
//Initialize
$(".selector").igCombo({
filteringCondition: "startsWith"
});
//Get
var condition = $(".selector").igCombo("option", "filteringCondition");
//Set
$(".selector").igCombo("option", "filteringCondition", "startsWith");
```
contains type="string"
doesNotContain type="string"
startsWith type="string"
endsWith type="string"
greaterThan type="string"
lessThan type="string"
greaterThanOrEqualTo type="string"
lessThanOrEqualTo type="string"
equals type="string"
doesNotEqual type="string"
*/
filteringCondition: "contains",
/* type="OR|AND" Gets/Sets filtering logic.
```
//Initialize
$(".selector").igCombo({
filteringLogic: "and"
});
//Get
var filteringLogic = $(".selector").igCombo("option", "filteringLogic");
//Set
$(".selector").igCombo("option", "filteringLogic", "or");
```
OR type="string"
AND type="string"
*/
filteringLogic: "OR",
/* @Removed@ type="string" This option has been removed as of 2017.2 Volume release.
Gets/Sets text of list item for condition when [filteringType](ui.igcombo#options:filteringType) option is enabled and no match was found.
Use option [locale.noMatchFoundText](ui.igcombo#options:locale.noMatchFoundText).
*/
noMatchFoundText: undefined,
/* @Removed@ type="string" This option has been removed as of 2017.2 Volume release.
Gets/Sets title for html element which represent the drop-down button.
Use option [locale.dropDownButtonTitle](ui.igcombo#options:locale.dropDownButtonTitle).
*/
dropDownButtonTitle: undefined,
/* @Removed@ type="string" This option has been removed as of 2017.2 Volume release.
Gets/Sets title for html element which represent clear button.
Use option [locale.clearButtonTitle](ui.igcombo#options:locale.clearButtonTitle).
*/
clearButtonTitle: undefined,
/* @Removed@ type="string" This option has been removed as of 2017.2 Volume release.
Gets/Sets value that is displayed when input field is empty.
Use option [locale.placeHolder](ui.igcombo#options:locale.placeHolder).
*/
placeHolder: undefined,
locale: {
/* type="object" Gets/Sets text of list item for condition when [filteringType](ui.igcombo#options:filteringType) option is enabled and no match was found.
```
//Initialize
$(".selector").igCombo({
locale: {
noMatchFoundText: "No match found"
}
});
//Get
var text = $(".selector").igCombo("option", "locale").noMatchFoundText;
//Set
$(".selector").igCombo("option", "locale", { noMatchFoundText: "No match found" });
```
*/
noMatchFoundText: undefined,
/* type="object" Gets/Sets title for html element which represent the drop-down button.
```
//Initialize
$(".selector").igCombo({
locale: {
dropDownButtonTitle: "Open Dropdown"
}
});
//Get
var text = $(".selector").igCombo("option", "locale").dropDownButtonTitle;
//Set
$(".selector").igCombo("option", "locale", { dropDownButtonTitle: "Open Dropdown" });
```
*/
dropDownButtonTitle: undefined,
/* type="object" Gets/Sets title for html element which represent the clear button.
```
//Initialize
$(".selector").igCombo({
locale: {
clearButtonTitle: "Clear value"
}
});
//Get
var text = $(".selector").igCombo("option", "locale").clearButtonTitle;
//Set
$(".selector").igCombo("option", "locale", { clearButtonTitle: "Clear value" });
```
*/
clearButtonTitle: undefined,
/* type="object" Gets/Sets value that is displayed when input field is empty.
```
//Initialize
$(".selector").igCombo({
locale: {
placeHolder: "Empty input field"
}
});
//Get
var text = $(".selector").igCombo("option", "locale").placeHolder;
//Set
$(".selector").igCombo("option", "locale", { placeHolder: "Empty input field" });
```
*/
placeHolder: undefined
},
/* type="object" Gets/Sets container of variables which define load on demand functionality.
Notes:
That option has effect only when data is loaded remotely using [dataSourceUrl](ui.igcombo#options:dataSourceUrl).
Selection is supported only for already loaded items.
```
//Initialize
$(".selector").igCombo({
loadOnDemandSettings: {
enabled: true,
pageSize: 55
}
});
//Get
var loadOnDemandSettings = $(".selector").igCombo("option", "loadOnDemandSettings");
//Get the enabled state
loadOnDemandSettings.enabled;
//Get the drop down list page size
loadOnDemandSettings.pageSize;
//Set
$(".selector").igCombo("option", "loadOnDemandSettings", { enabled: true, pageSize: 55 });
```
*/
loadOnDemandSettings: {
/* type="bool" Gets/Sets option to enable load on demand.
```
//Initialize
$(".selector").igCombo({
loadOnDemandSettings: { enabled: true }
});
//Get
var loadOnDemandSettings = $(".selector").igCombo("option", "loadOnDemandSettings");
//Get the enabled state
loadOnDemandSettings.enabled;
//Set
$(".selector").igCombo("option", "loadOnDemandSettings", { enabled: true });
```
*/
enabled: false,
/* type="number" Gets/Sets number of records loaded on each request.
```
//Initialize
$(".selector").igCombo({
loadOnDemandSettings: {
enabled: true,
pageSize: 55
}
});
//Get
var loadOnDemandSettings = $(".selector").igCombo("option", "loadOnDemandSettings");
//Get the drop down list page size
loadOnDemandSettings.pageSize;
//Set
$(".selector").igCombo("option", "loadOnDemandSettings", { enabled: true, pageSize: 55 });
```*/
pageSize: 16
},
/* type="number" Gets/Sets how many items should be shown at once.
Notes:
This option is used for [virtualization](ui.igcombo#options:virtualization) in order to render initial list items.
```
//Initialize
$(".selector").igCombo({
visibleItemsCount: 22
});
//Get
var count = $(".selector").igCombo("option", "visibleItemsCount");
//Set
$(".selector").igCombo("option", "visibleItemsCount", 33 });
```
*/
visibleItemsCount: 15,
/* type="editable|dropdown|readonlylist|readonly" Sets gets functionality mode.
editable type="string" Allows to modify value by edit field and drop-down list.
dropdown type="string" Allows to modify value by drop-down list only.
readonlylist type="string" Allows to open list, but does not allow any changes in field or selection in drop-down list. If selection is not set, then first item in [dataSource](ui.igcombo#options:dataSource) is automatically selected.
readonly type="string" Does not allow to open list or change value in field. If selection is not set, then first item in [dataSource](ui.igcombo#options:dataSource) is automatically selected.
```
//Initialize
$(".selector").igCombo({
mode: "readonlylist"
});
//Get
var mode = $(".selector").igCombo("option", "mode");
```
*/
mode: "editable",
/* type="bool" Gets/Sets ability to use virtual rendering for drop-down list. Enable to boost performance when combo has lots of records.
If that option is enabled, then only visible items are created and the top edge of the first visible item in list is aligned to the top edge of list.
```
//Initialize
$(".selector").igCombo({
virtualization: true
});
//Get
var isVirtualizationEnabled = $(".selector").igCombo("option", "virtualization");
```
*/
virtualization: false,
/* type="object" Gets/Sets object specifying multi selection feature options. Note showCheckboxes and itemSeparator has effect only if multi selection is enabled.
```
//Initialize
$(".selector").igCombo({
multiSelection: {
enabled: true,
addWithKeyModifier: false,
showCheckboxes: false,
itemSeparator: ', '
}
});
//Get
var multiSelection = $(".selector").igCombo("option", "multiSelection");
``` */
multiSelection: {
/* type="bool" Set enabled to true to turn multi selection on. Set to true by default when target element for the combo is a select with the multiple attribute set.
```
//Initialize
$(".selector").igCombo({
multiSelection: {
enabled: true
}
});
//Get
var multiSelection = $(".selector").igCombo("option", "multiSelection");
var enabled = multiSelection.enabled;
//Set
$(".selector").igCombo("option", "multiSelection", { enabled: true });
```
*/
enabled: false,
/* type="bool" Set addWithKeyModifier to true to disable the additive selection, then additive selection can be done by ctrl + mouse click / enter.
```
//Initialize
$(".selector").igCombo({
multiSelection: {
addWithKeyModifier: true
}
});
//Get
var multiSelection = $(".selector").igCombo("option", "multiSelection");
var addWithKeyModifier = multiSelection.addWithKeyModifier;
//Set
$(".selector").igCombo("option", "multiSelection", { addWithKeyModifier: true });
```
*/
addWithKeyModifier: false,
/* type="bool" Set showCheckboxes to true to render check boxes in front of each drop down item.
```
//Initialize
$(".selector").igCombo({
multiSelection: {
showCheckboxes: true
}
});
//Get
var multiSelection = $(".selector").igCombo("option", "multiSelection");
var showCheckboxes = multiSelection.showCheckboxes;
//Set
$(".selector").igCombo("option", "multiSelection", { showCheckboxes: false });
```
*/
showCheckboxes: false,
/* type="string" Use itemSeparator to set what string to be rendered between items in field.
```
//Initialize
$(".selector").igCombo({
multiSelection: {
itemSeparator: ", "
}
});
//Get
var multiSelection = $(".selector").igCombo("option", "multiSelection");
var itemSeparator = multiSelection.itemSeparator;
//Set
$(".selector").igCombo("option", "multiSelection", { itemSeparator: ". " });
```
*/
itemSeparator: ", "
},
/* type="object" Gets/Sets object specifying grouping feature options. The option has key and dir properties.
```
//Initialize
$(".selector").igCombo({
grouping: {
key: "Country",
dir: "desc"
}
});
//Get
var grouping = $(".selector").igCombo("option", "grouping");
//Set
$(".selector").igCombo("option", "grouping", { key: "Age", dir: "asc" });
```
*/
grouping: {
/* type="string" Gets/Sets name of column by which the records will be grouped. Setting this option enables the grouping.
```
//Initialize
$(".selector").igCombo({
grouping: {
key: "Country"
}
});
//Get
var grouping = $(".selector").igCombo("option", "grouping");
var key = grouping.key;
//Set
$(".selector").igCombo("option", "grouping", { key: "Age" });
```
*/
key: null,
/* type="asc|desc" Specifies the sort order - ascending or descending.
```
//Initialize
$(".selector").igCombo({
grouping: {
key: "Country",
dir: "desc"
}
});
//Get
var grouping = $(".selector").igCombo("option", "grouping");
var dir = grouping.dir;
//Set
$(".selector").igCombo("option", "grouping", { dir: "asc" });
```
asc type="string"
desc type="string"
*/
dir: "asc"
},
/* type="object" Gets/Sets object which contains options supported by [igValidator](ui.igvalidator).
Notes: in order for validator to work, application should ensure that [igValidator](ui.igvalidator) is loaded (ig.ui.validator.js/css files).
```
//Initialize
$(".selector").igCombo({
validatorOptions: {
required: true
}
});
//Get
var validatorOptions = $(".selector").igCombo("option", "validatorOptions");
//Set
$(".selector").igCombo("option", "validatorOptions", {
required: true
});
```
*/
validatorOptions: null,
/* type="multi|contains|startsWith|full|null" Gets/Sets condition used for highlighting of matching parts in items of drop-down list.
```
//Initialize
$(".selector").igCombo({
highlightMatchesMode: "startsWith"
});
//Get
var highlightMatchesMode = $(".selector").igCombo("option", "highlightMatchesMode");
//Set
$(".selector").igCombo("option", "highlightMatchesMode", "full");
```
multi type="string" multiple matches in a single item are rendered
contains type="string" match at any position in item is rendered
startsWith type="string" only match which starts from the beginning of text is rendered
full type="string" only fully matched items are rendered
null type="object" matches are not rendered
*/
highlightMatchesMode: "multi",
/* type="bool" If set to true, filtering and auto selection will be case-sensitive.
```
//Initialize
$(".selector").igCombo({
caseSensitive: true
});
//Get
var caseSensitive = $(".selector").igCombo("option", "caseSensitive");
//Set
$(".selector").igCombo("option", "caseSensitive", true);
```
*/
caseSensitive: false,
/* type="bool" Gets/Sets whether the first matching item should be auto selected when typing in input. When [multiSelection](ui.igcombo#options:multiSelection) is enabled this option will instead put the active item on the matching element.
```
//Initializes
$(".selector").igCombo({
autoSelectFirstMatch: false
});
//Get
var autoSelectFirstMatch = $(".selector").igCombo("option", "autoSelectFirstMatch");
//Set
$(".selector").igCombo("option", "autoSelectFirstMatch", true);
```
*/
autoSelectFirstMatch: true,
/* type="bool" Gets/Sets ability to autocomplete field from first matching item in list.
Note: When autoComplete option is enabled, then "startsWith" is used for [filteringCondition](ui.igcombo#options:filteringCondition).
```
//Initialize
$(".selector").igCombo({
autoComplete: true
});
//Get
var autoComplete = $(".selector").igCombo("option", "autoComplete");
//Set
$(".selector").igCombo("option", "autoComplete", false);
```
*/
autoComplete: false,
/* type="bool" If set to true:
1. Allows custom value input only with single selection.
2. Custom values will be auto completed to the closest value if [autoComplete](ui.igcombo#options:autoComplete) is enabled.
```
//Initialize
$(".selector").igCombo({
allowCustomValue: true
});
//Get
var allowCustomValue = $(".selector").igCombo("option", "allowCustomValue");
//Set
$(".selector").igCombo("option", "allowCustomValue", false);
```
*/
allowCustomValue: false,
/* type="bool" Gets/Sets ability to close drop-down list when control loses focus.
```
//Initialize
$(".selector").igCombo({
closeDropDownOnBlur: false
});
//Get
var closeDropDownOnBlur = $(".selector").igCombo("option", "closeDropDownOnBlur");
//Set
$(".selector").igCombo("option", "closeDropDownOnBlur", false);
```
*/
closeDropDownOnBlur: true,
/* type="number" Specifies the delay duration before processing the changes in the input. Useful to boost performance by lowering the count of selection, filtering, auto complete and highlighting operations executed on each input change.
```
//Initialize
$(".selector").igCombo({
delayInputChangeProcessing: 500
});
//Get
var delayInputChangeProcessing = $(".selector").igCombo("option", "delayInputChangeProcessing");
//Set
$(".selector").igCombo("option", "delayInputChangeProcessing", 1000);
```
*/
delayInputChangeProcessing: 250,
/* type="number" Gets/Sets tabIndex for the field of the combo.
```
//Initialize
$(".selector").igCombo({
tabIndex: 3
});
//Get
var tabIndex = $(".selector").igCombo("option", "tabIndex");
//Set
$(".selector").igCombo("option", "tabIndex", 3);
```
*/
tabIndex: null,
/* type="bool" Gets/Sets ability to show the drop-down list when the combo is in focus. This option has effect only if the combo is in editable [mode](ui.igcombo#options:mode).
```
//Initialize
$(".selector").igCombo({
dropDownOnFocus: true
});
//Get
var dropDownOnFocus = $(".selector").igCombo("option", "dropDownOnFocus");
//Set
$(".selector").igCombo("option", "dropDownOnFocus", true);
```
*/
dropDownOnFocus: false,
/* type="bool" Gets sets ability to close drop-down list when single item in the list is selected with mouse click or enter press. The default value when [multiSelection](ui.igcombo#options:multiSelection) is enabled will be false. This option will not close the drop down when [multiSelection](ui.igcombo#options:multiSelection) is enabled and additive selection is performed.
```
//Initialize
$(".selector").igCombo({
closeDropDownOnSelect: false
});
//Get
var closeDropDownOnSelect = $(".selector").igCombo("option", "closeDropDownOnSelect");
//Set
$(".selector").igCombo("option", "closeDropDownOnSelect", false);
```
*/
closeDropDownOnSelect: true,
/* type="bool" Gets/Sets ability to select items by space button press.
```
//Initialize
$(".selector").igCombo({
selectItemBySpaceKey: true
});
//Get
var selectSpace = $(".selector").igCombo("option", "selectItemBySpaceKey");
//Set
$(".selector").igCombo("option", "selectItemBySpaceKey", true);
```
*/
selectItemBySpaceKey: false,
/* type="array" Gets/Sets list of items to be selected when the combo is initialized. It should contain array of objects with index or value property, then on initialization the matching items will be selected. If initialSelectedItems are not set, the combo is with single selection and it is in a dropdown, readonly or readonlylist [mode](ui.igcombo#options:mode), the first item will be automatically selected.
Note: Only items loaded on initialization can be selected. When using [load on demand](ui.igCombo#options:loadOnDemandSettings), selecting an item which is not loaded yet will fail.
```
//Initialize with index
$(".selector").igCombo({
multiSelection: {
enabled: true
},
initialSelectedItems: [
{ index: 0 },
{ index: 1 },
{ index: 2 }
]
});
//Initialize with value
$(".selector").igCombo({
initialSelectedItems: [
{ value: 5 }
]
});
//Get
var initialSelectedItems = $(".selector").igCombo("option", "initialSelectedItems");
```
*/
initialSelectedItems: [{
/* type="number" optional="true" Index of item in the list. The index should be greater than -1 and less than the count of the [items](ui.igcombo#methods:items) in the list (rows in dataSource).
```
//Initialize
$(".selector").igCombo({
multiSelection: {
enabled: true
},
initialSelectedItems: [
{ index: 1 },
{ index: 3 },
{ index: 5 }
]
});
//Get