Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
igx-grid beginAddRowByIndex supply default values

I am currently using the beginAddRowByIndex function with batchEdit, and want to be able to supply an object that contains default values for some of the columns. Looking through the grid base component, as well as the crud service, I didn't see any great way of doing it. Instead I tried listening to the rowEditEnter EventEmitter, and updated the e.rowData object to my liking. I then called e.owner.detectChanges(). This updated the new row to contain my default values, however, when the row was committed, it didn't contain my default values.

I also tried the following to options in rowEditEnter, to no avail:

  • e.newValue = Object.assign({}, e.rowData, { property1: 'blah' });
  • e.rowData= Object.assign({}, e.rowData, { property1: 'blah' });

Is there a different way that I can provide these values to the user, and have them persist (unless changed by the user) when the row is committed?

I also reviewed this support ticket from a while back, because I will need to set multiple column values when a column changes, but the provided solution doesn't work for rows that are added via beginAddRowByIndex. How can the solution in the support ticket be modified to work for new rows as well?

Parents Reply Children
No Data