nhn / tui.grid

🍞🔡 The Powerful Component to Display and Edit Data. Experience the Ultimate Data Transformer!
http://ui.toast.com/tui-grid/
MIT License
2.42k stars 398 forks source link

Richer per-column, before+after data for getModifiedRows/request behaviour #1380

Open Nitrodist opened 3 years ago

Nitrodist commented 3 years ago

Version

tui-grid@^4.17.2:

Development Environment

Mac OS + Chrome

Current Behavior

I am integrating tui.grid and when I use grid.getModifiedRows, I get the entire row back that I've changed. With grid.request('updateData') I also get back the entire row.

The issue is that I've only changed one column - this is an issue because I don't want to clobber (overwrite) other columns that I haven't modified.

I have an event bound to grid.on afterChange which gives me the desired data like this:

     [{
       columnName: "team_fouls",
       prevValue: null,
       rowKey: 1,
      value: "3"
     }]

Unfortunately, that information is lost when I invoke grid.request('updateData') because the entire row is sent then. At this point I have to construct my own request to sync just that column of data instead of using grid.request.

Expected Behavior

grid.request's behaviour can still send the entire row of data that's been modified, but also it should include information about which columns in the row have changed, the old values of the columns, and the new values.

I'm open to alternatives solutions.

js87zz commented 3 years ago

@Nitrodist That's better to use. I'll consider it! Thank you!