|
1705 | 1705 | if (!options.textKey) { |
1706 | 1706 | if (options.valueKey) { |
1707 | 1707 | options.textKey = options.valueKey; |
1708 | | - } else if (firstDataItem && $.type(firstDataItem) === "object") { |
| 1708 | + } else if (firstDataItem && $.ig.util.getType(firstDataItem) === "object") { |
1709 | 1709 |
|
1710 | 1710 | // Use first data source column |
1711 | 1711 | for (key in firstDataItem) { |
|
2067 | 2067 | _formatItem: function (item) { |
2068 | 2068 | if ($.ig && $.ig.formatter) { |
2069 | 2069 | if (this.options.format === "auto" && |
2070 | | - ($.type(item) === "date" || $.type(item) === "number")) { |
| 2070 | + ($.ig.util.getType(item) === "date" || $.ig.util.getType(item) === "number")) { |
2071 | 2071 | item = $.ig.formatter({ |
2072 | 2072 | "val": item, |
2073 | 2073 | "reg": $.ig.regional[ this.options.regional ] |
|
2523 | 2523 | _convertToArrayOfObjects: function (options) { |
2524 | 2524 | var curData, len, i, ds; |
2525 | 2525 |
|
2526 | | - if ($.type(options.dataSource) === "object" && (options.dataSource._data !== null && |
| 2526 | + if ($.ig.util.getType(options.dataSource) === "object" && (options.dataSource._data !== null && |
2527 | 2527 | options.dataSource._data !== undefined)) { |
2528 | 2528 | ds = options.dataSource._data; |
2529 | 2529 | } else { |
2530 | 2530 | ds = options.dataSource; |
2531 | 2531 | } |
2532 | 2532 |
|
2533 | | - if ($.type(ds) === "array" && ($.type(ds[ 0 ]) === "number" || |
2534 | | - $.type(ds[ 0 ]) === "string" || $.type(ds[ 0 ]) === "date")) { |
| 2533 | + if ($.ig.util.getType(ds) === "array" && ($.ig.util.getType(ds[ 0 ]) === "number" || |
| 2534 | + $.ig.util.getType(ds[ 0 ]) === "string" || $.ig.util.getType(ds[ 0 ]) === "date")) { |
2535 | 2535 | for (i = 0, len = ds.length; i < len; i++) { |
2536 | 2536 | curData = ds[ i ]; |
2537 | 2537 |
|
|
2624 | 2624 | $items = $items || this._$items(); |
2625 | 2625 |
|
2626 | 2626 | // Handle data as array |
2627 | | - if ($.type(data) !== "array") { |
| 2627 | + if ($.ig.util.getType(data) !== "array") { |
2628 | 2628 | data = [ data ]; |
2629 | 2629 | } |
2630 | 2630 |
|
|
2647 | 2647 | $items = $items || this._$items(); |
2648 | 2648 |
|
2649 | 2649 | // Handle value as array |
2650 | | - if ($.type(value) !== "array") { |
| 2650 | + if ($.ig.util.getType(value) !== "array") { |
2651 | 2651 | value = [ value ]; |
2652 | 2652 | } |
2653 | 2653 |
|
|
2671 | 2671 | var i, |
2672 | 2672 | result = $(); |
2673 | 2673 |
|
2674 | | - if ($.type(items) !== "array") { |
| 2674 | + if ($.ig.util.getType(items) !== "array") { |
2675 | 2675 | items = [ items ]; |
2676 | 2676 | } |
2677 | 2677 |
|
|
2714 | 2714 | var data2Len, |
2715 | 2715 | self = this; |
2716 | 2716 |
|
2717 | | - if ($.type(data1) !== "array") { |
| 2717 | + if ($.ig.util.getType(data1) !== "array") { |
2718 | 2718 | data1 = [ data1 ]; |
2719 | 2719 | } |
2720 | 2720 |
|
2721 | | - if ($.type(data2) !== "array") { |
| 2721 | + if ($.ig.util.getType(data2) !== "array") { |
2722 | 2722 | data2 = [ data2 ]; |
2723 | 2723 | } |
2724 | 2724 |
|
|
2807 | 2807 | } |
2808 | 2808 |
|
2809 | 2809 | // Handle item as array |
2810 | | - if ($.type(item) !== "array") { |
| 2810 | + if ($.ig.util.getType(item) !== "array") { |
2811 | 2811 | item = [ item ]; |
2812 | 2812 | } |
2813 | 2813 |
|
|
2840 | 2840 | var data, i, len, |
2841 | 2841 | result = [ ]; |
2842 | 2842 |
|
2843 | | - if ($.type(value) !== "array") { |
| 2843 | + if ($.ig.util.getType(value) !== "array") { |
2844 | 2844 | value = [ value ]; |
2845 | 2845 | } |
2846 | 2846 |
|
|
2887 | 2887 | result = [ ]; |
2888 | 2888 |
|
2889 | 2889 | // Handle data as array |
2890 | | - if ($.type(data) !== "array") { |
| 2890 | + if ($.ig.util.getType(data) !== "array") { |
2891 | 2891 | data = [ data ]; |
2892 | 2892 | } |
2893 | 2893 |
|
|
3019 | 3019 | mode = this.options.mode; |
3020 | 3020 |
|
3021 | 3021 | // Handle selectedItems option |
3022 | | - if ($.type(selItems) === "array") { |
| 3022 | + if ($.ig.util.getType(selItems) === "array") { |
3023 | 3023 | for (i = 0; i < selItems.length; i++) { |
3024 | 3024 | curSelItem = selItems[ i ]; |
3025 | 3025 | curIndex = curSelItem.index; |
|
4976 | 4976 | this._options.$input.attr("disabled", true); |
4977 | 4977 | this._options.$hiddenInput.attr("disabled", true); |
4978 | 4978 | } else { |
4979 | | - this._options.$input.remoteProp("disabled"); |
4980 | | - this._options.$hiddenInput.removeProp("disabled"); |
| 4979 | + this._options.$input[0].removeAttribute("disabled"); |
| 4980 | + this._options.$hiddenInput[0].removeAttribute("disabled"); |
4981 | 4981 | } |
4982 | 4982 | }, |
4983 | 4983 | changeLocale: function () { |
|
5129 | 5129 | self = this, |
5130 | 5130 | lod = this.options.loadOnDemandSettings, |
5131 | 5131 | options = this.options, |
5132 | | - isStringDataSource = $.type(options.dataSource) === "string", |
| 5132 | + isStringDataSource = $.ig.util.getType(options.dataSource) === "string", |
5133 | 5133 | url = options.dataSourceUrl; |
5134 | 5134 |
|
5135 | 5135 | // Set the data source that should be used |
|
5144 | 5144 | } |
5145 | 5145 |
|
5146 | 5146 | // P.P. 29-June-2015 Bug #201942: We need to unwrap the data here, because of the following logic. |
5147 | | - if ($.type(options.dataSource) === "function") { |
| 5147 | + if ($.ig.util.getType(options.dataSource) === "function") { |
5148 | 5148 | options.dataSource = options.dataSource(); |
5149 | 5149 | } |
5150 | 5150 |
|
|
5208 | 5208 | } |
5209 | 5209 |
|
5210 | 5210 | // S.T. Feb 24th, 2015 Bug #189447: Handle when data source is JSONP. |
5211 | | - if ($.type(options.dataSource) === "string" && |
| 5211 | + if ($.ig.util.getType(options.dataSource) === "string" && |
5212 | 5212 | !options.dataSourceType && |
5213 | 5213 | $.ig.util.isJsonpUrl(options.dataSource)) { |
5214 | 5214 |
|
|
5316 | 5316 | if (firstDsRow.hasOwnProperty(field)) { |
5317 | 5317 | schema.fields.push({ |
5318 | 5318 | name: field, |
5319 | | - type: $.type(firstDsRow[ field ]) |
| 5319 | + type: $.ig.util.getType(firstDsRow[ field ]) |
5320 | 5320 | }); |
5321 | 5321 | } |
5322 | 5322 | } |
|
5329 | 5329 | _generateExpressions: function (texts) { |
5330 | 5330 | var i, expressions = [ ]; |
5331 | 5331 |
|
5332 | | - if ($.type(texts) === "string") { |
| 5332 | + if ($.ig.util.getType(texts) === "string") { |
5333 | 5333 |
|
5334 | 5334 | // K.D. March 3rd, 2015 Bug #189365 When clearing the filter leave the array empty. |
5335 | 5335 | if (texts.length > 0 || (this._options.expression && |
|
5345 | 5345 | cond: this._filteringCondition() |
5346 | 5346 | }); |
5347 | 5347 | } |
5348 | | - } else if ($.type(texts) === "array") { |
| 5348 | + } else if ($.ig.util.getType(texts) === "array") { |
5349 | 5349 | for (i = 0; i < texts.length; i++) { |
5350 | | - if ($.type(texts[ i ]) === "string") { |
| 5350 | + if ($.ig.util.getType(texts[ i ]) === "string") { |
5351 | 5351 | expressions.push({ |
5352 | 5352 | fieldName: this.options.textKey, |
5353 | 5353 | expr: texts[ i ], |
|
5381 | 5381 | } |
5382 | 5382 | }; |
5383 | 5383 |
|
5384 | | - if ($.type(texts) === "string") { |
| 5384 | + if ($.ig.util.getType(texts) === "string") { |
5385 | 5385 | texts = [ texts ]; |
5386 | 5386 | } |
5387 | 5387 |
|
|
5395 | 5395 | }); |
5396 | 5396 |
|
5397 | 5397 | if (texts.length > 0) { |
5398 | | - if ($.type(types[ this.options.highlightMatchesMode ]) === "function") { |
| 5398 | + if ($.ig.util.getType(types[ this.options.highlightMatchesMode ]) === "function") { |
5399 | 5399 | pattern = types[ this.options.highlightMatchesMode ](texts); |
5400 | 5400 | } else { |
5401 | 5401 | throw new Error(this._getLocaleValue("errorUnrecognizedHighlightMatchesMode")); |
|
5815 | 5815 | var curCallback, i, |
5816 | 5816 | callbacks = this._options.internalSelChangeSubs; |
5817 | 5817 |
|
5818 | | - if ($.type(callbacks) === "array") { |
| 5818 | + if ($.ig.util.getType(callbacks) === "array") { |
5819 | 5819 | for (i = 0; i < callbacks.length; i++) { |
5820 | 5820 | curCallback = callbacks[ i ]; |
5821 | 5821 |
|
|
6194 | 6194 | $items = this._$items(), |
6195 | 6195 | result = null; |
6196 | 6196 |
|
6197 | | - if ($.type(value) === "array") { |
| 6197 | + if ($.ig.util.getType(value) === "array") { |
6198 | 6198 | // Filter duplicate values |
6199 | 6199 | value = $.grep(value, function (val, index) { |
6200 | 6200 | return self._isValueInArray(val, value) === index; |
|
6247 | 6247 | dataLen = data.length, |
6248 | 6248 | valKey = this.options.valueKey; |
6249 | 6249 |
|
6250 | | - if ($.type(index) === "array") { |
| 6250 | + if ($.ig.util.getType(index) === "array") { |
6251 | 6251 | value = [ ]; |
6252 | 6252 |
|
6253 | 6253 | for (i = 0; i < index.length; i++) { |
|
6552 | 6552 | self._updateItems(offset); |
6553 | 6553 | } |
6554 | 6554 |
|
6555 | | - if ($.type(callback) === "function") { |
| 6555 | + if ($.ig.util.getType(callback) === "function") { |
6556 | 6556 | callback(); |
6557 | 6557 | } |
6558 | 6558 |
|
|
6672 | 6672 | self.clearFiltering(event); |
6673 | 6673 | } |
6674 | 6674 |
|
6675 | | - if ($.type(callback) === "function") { |
| 6675 | + if ($.ig.util.getType(callback) === "function") { |
6676 | 6676 | callback(); |
6677 | 6677 | } |
6678 | 6678 |
|
|
6808 | 6808 | returnValue = { combo: this, selectionCanceled: false }; |
6809 | 6809 |
|
6810 | 6810 | // Use first data when multi selection is not enabled |
6811 | | - data = ($.type(data) === "array" && !multiSelEnabled) ? data[ 0 ] : data; |
| 6811 | + data = ($.ig.util.getType(data) === "array" && !multiSelEnabled) ? data[ 0 ] : data; |
6812 | 6812 | items = this._itemsFromData(data); |
6813 | 6813 |
|
6814 | 6814 | options = options || {}; |
|
6823 | 6823 | return returnValue; |
6824 | 6824 | } |
6825 | 6825 |
|
6826 | | - if ($.type(items) !== "array") { |
| 6826 | + if ($.ig.util.getType(items) !== "array") { |
6827 | 6827 | items = [ items ]; |
6828 | 6828 | } |
6829 | 6829 |
|
|
7162 | 7162 | return indexes; |
7163 | 7163 | } |
7164 | 7164 |
|
7165 | | - if ($.type(index) !== "array") { |
| 7165 | + if ($.ig.util.getType(index) !== "array") { |
7166 | 7166 | index = [ index ]; |
7167 | 7167 | } |
7168 | 7168 |
|
|
7226 | 7226 | return this; |
7227 | 7227 | } |
7228 | 7228 |
|
7229 | | - if ($.type(items) !== "array") { |
| 7229 | + if ($.ig.util.getType(items) !== "array") { |
7230 | 7230 | items = [ items ]; |
7231 | 7231 | } |
7232 | 7232 |
|
|
7376 | 7376 | var i, len, |
7377 | 7377 | dataToDeselect = [ ]; |
7378 | 7378 |
|
7379 | | - if ($.type(index) !== "array") { |
| 7379 | + if ($.ig.util.getType(index) !== "array") { |
7380 | 7380 | index = [ index ]; |
7381 | 7381 | } |
7382 | 7382 |
|
|
0 commit comments