I am having a hangup as to how to handle making ajax calls for each record in a grid that is changed.
So I have a grid with 4 editable columns. The grid has an "edit" listener. The listener pushes a record to an array every time a cell is edited. There is a save button that allows the user to save their changes (commit to the database). However, since I have 4 editable columns per row, I need to only retain 1 record in my array per row in the grid. Right now, I am pushing 4 records into the array when I've only edited 1 row in the grid.
So my first reaction was to ask, "how do I query the array to see if the record already exists?" If it does exist, I just want to update the changed contents of that record in the array. My record will contain 4 key values as well. Those 4 key values would denote the unique record.
Am I way off base on how to handle cell editing?
So I have a grid with 4 editable columns. The grid has an "edit" listener. The listener pushes a record to an array every time a cell is edited. There is a save button that allows the user to save their changes (commit to the database). However, since I have 4 editable columns per row, I need to only retain 1 record in my array per row in the grid. Right now, I am pushing 4 records into the array when I've only edited 1 row in the grid.
So my first reaction was to ask, "how do I query the array to see if the record already exists?" If it does exist, I just want to update the changed contents of that record in the array. My record will contain 4 key values as well. Those 4 key values would denote the unique record.
Am I way off base on how to handle cell editing?
Comment