@syncfusion/ej2-dropdowns 32.2.3 → 32.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5418,30 +5418,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5418
5418
  const checkField = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
5419
5419
  const value = this.allowObjectBinding && !isNullOrUndefined(this.value) ?
5420
5420
  getValue(checkField, this.value) : this.value;
5421
- const fieldValue = this.fields.value.split('.');
5422
- let checkVal = list.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
5423
- this.checkFieldValue(x, fieldValue) === value : x[checkField] === value);
5424
- if (this.enableVirtualization && this.virtualGroupDataSource) {
5425
- checkVal = this.virtualGroupDataSource.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
5426
- this.checkFieldValue(x, fieldValue) === value : x[checkField] === value);
5427
- }
5428
- if (!checkVal && !this.enableVirtualization) {
5429
- this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', value)))
5430
- .then((e) => {
5431
- if (e.result.length > 0) {
5432
- if (!this.enableVirtualization) {
5433
- this.addItem(e.result, list.length);
5434
- }
5435
- this.updateValues();
5436
- }
5437
- else {
5438
- this.updateValues();
5439
- }
5440
- });
5441
- }
5442
- else {
5443
- this.updateValues();
5444
- }
5421
+ this.checkAndFetchItemData(list, value, checkField);
5445
5422
  }
5446
5423
  else {
5447
5424
  this.updateValues();
@@ -5549,6 +5526,41 @@ let DropDownList = class DropDownList extends DropDownBase {
5549
5526
  });
5550
5527
  return checkField;
5551
5528
  }
5529
+ checkAndFetchItemData(list, value, checkField) {
5530
+ const fieldValue = this.fields.value.split('.');
5531
+ let checkVal = list.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
5532
+ this.checkFieldValue(x, fieldValue) === value : x[checkField] === value);
5533
+ if (this.enableVirtualization && this.virtualGroupDataSource) {
5534
+ checkVal = this.virtualGroupDataSource.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
5535
+ this.checkFieldValue(x, fieldValue) === value : x[checkField] === value);
5536
+ }
5537
+ if (!checkVal && this.dataSource instanceof DataManager) {
5538
+ (this.dataSource).executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', value)))
5539
+ .then((e) => {
5540
+ if (e.result.length > 0) {
5541
+ if (!this.enableVirtualization) {
5542
+ this.addItem(e.result, list.length);
5543
+ }
5544
+ else {
5545
+ this.itemData = e.result[0];
5546
+ const dataItem = this.getItemData();
5547
+ if ((this.value === dataItem.value && this.text !== dataItem.text) ||
5548
+ (this.value !== dataItem.value && this.text === dataItem.text)) {
5549
+ this.setProperties({ text: dataItem.text.toString() });
5550
+ Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
5551
+ }
5552
+ }
5553
+ this.updateValues();
5554
+ }
5555
+ else {
5556
+ this.updateValues();
5557
+ }
5558
+ });
5559
+ }
5560
+ else {
5561
+ this.updateValues();
5562
+ }
5563
+ }
5552
5564
  updateActionCompleteDataValues(ulElement, list) {
5553
5565
  this.actionCompleteData = { ulElement: ulElement.cloneNode(true), list: list, isUpdated: true };
5554
5566
  if (this.actionData.list !== this.actionCompleteData.list && this.actionCompleteData.ulElement && this.actionCompleteData.list) {
@@ -6962,6 +6974,12 @@ let DropDownList = class DropDownList extends DropDownBase {
6962
6974
  return;
6963
6975
  }
6964
6976
  if (this.enableVirtualization) {
6977
+ if (newProp.value && this.dataSource instanceof DataManager) {
6978
+ const checkField = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
6979
+ const value = this.allowObjectBinding && !isNullOrUndefined(newProp.value) ?
6980
+ getValue(checkField, newProp.value) : newProp.value;
6981
+ this.checkAndFetchItemData(this.listData, value, checkField);
6982
+ }
6965
6983
  this.updateValues();
6966
6984
  this.updateInputFields();
6967
6985
  this.notify('setCurrentViewDataAsync', {