edited value in grid disappears

Hi,

I have this template:

<ejs-grid [datasource]="rows" height="100%" width="100%" enablestickyheader="true" allowpaging="true" [editsettings]="editSettings" [pagesettings]="pageSettings" (actionbegin)="actionBegin($event)">

  <e-columns>

    <e-column field="id" headertext="id" width="100" isprimarykey="true"></e-column>

    <e-column field="accountNumber.accNumber" headertext="acc number" width="170">

      <ng-template #edittemplate="" let-data="">

        <ejs-combobox [datasource]="accountNumbers" [(value)]="row.accountNumber!.accNumber" [fields]="{ text: 'accNumber', value: 'accNumber' }" filtertype="Contains"></ejs-combobox>

      </ng-template>

    </e-column>

    <e-column field="accountNumber.accName" headertext="acc name" width="120" [allowediting]="false"></e-column>

    <e-column field="project.projNumber" headertext="proj number" width="200">

      <ng-template #edittemplate="" let-data="">

        <ejs-multicolumncombobox id="multicolumn" popupwidth="500px" [(value)]="row.project!.projNumber" [datasource]="projects" [fields]="{ text: 'projNumber', value: 'projNumber' }" filtertype="Contains">

          <e-columns>

            <e-column field="id" header="Project ID" width="70"></e-column>

            <e-column field="projName" header="Name" width="100"></e-column>

            <e-column field="projNumber" header="Number" width="100"></e-column>

          </e-columns>

        </ejs-multicolumncombobox>

      </ng-template>

    </e-column>

</e-columns>

</ejs-grid>

And this codebehind:

@Component({
  selector: 'normal-grid',
  imports: [
    GridModule,
    CheckBoxModule,
    DropDownListModule,
    MultiColumnComboBoxModule,
    CommonModule,
    FormsModule,
    ComboBoxModule,
  ],
  providers: [PageService, EditService],
  templateUrl: './normal-grid.component.html',
})
export class NormalGridComponent {
  row: Row = {};
  rows: Row[] = inject(DataService).generateData(200);
  accountNumbers: AccountNumber[] = accountNumbers;
  projects: Project[] = projects;
  pageSettings = {
    pageSizes: ['5', '10', '15', '20', '50', '100', 'All'],
    pageSize: 200,
  };
  editSettings = {
    allowEditing: true,
    allowAdding: false,
    allowDeleting: false,
  };
  actionBegin(args: SaveEventArgs) {
    if (args.requestType === 'beginEdit' || args.requestType === 'add') {
      Object.assign(this.row, args.rowData);
    }
    if (args.requestType === 'save') {
      args.data = this.row;
    }
  }
}

For some reason, if I enter in edit mode and change the project number in such way, that I delete all the text and
enter f. e. 100 and then select the proj number 100 from the list, and hit enter, there will be no value in the grid.
But if I only remove f. e. the numbers from the end of the text and enter an other number and select it and hit
enter, then the value is there in the grid. Interestingly the other field accountNumber.accNumber doesn't have
this problem.

So, could you check, what could cause this problem?

ps: btw. is there any code formatting tool in this editor? I didn't find any.



2 Replies

MR Mohanraj Rengasamy Syncfusion Team April 8, 2025 05:47 AM UTC

Hi Balázs Varga,


Greetings from Syncfusion support.


We have conformed the reported scenario as a bug from our end and logged it as “ Value is not maintained properly after we select an option and pressed "enter" key”. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technical feasibility and Product Development Life Cycle ) and will include the defect fix in our upcoming patch release which will be rolled in the end of April 2025.


You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through the below link,


Feedback:  https://www.syncfusion.com/feedback/66777/value-is-not-maintained-properly-after-we-select-an-option-and-pressed-enter-key


Disclaimer: "Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization".


Regards,

Mohanraj Rengasamy



KN Kundurthi Naga Siddartha Kundurthi Vennela Prasad Syncfusion Team May 6, 2025 12:21 PM UTC

Hi Balázs Varga,


We have included the fix for the issue “Value is not maintained properly after we select an option and pressed 'enter' key” with our package version “29.1.41”. Therefore, we recommend upgrading to our latest version to resolve the current issue.


Rootcause:

Based on matchedContent and exactMatchedContent private variable, the input value will be clear while enter key down action for multi column combo box input.


Sample: https://stackblitz.com/edit/angular-nseyxyee-adtgda3c?file=package.json  

Regards,

K N Siddartha.


Loader.
Up arrow icon