Upgrade from v1.6.1 to v1.7.4
Upgrade from v1.6.1 to v1.7.4
Updating Editor from v1.6.1 to v1.7.4 breaks my code. I read through the prior release notes and I didn't notice anything that indicated a breaking change except for a new required parameter added to submitSuccess I believe.
Inline editing.
The data is in an array of objects. The row id is an integer.
The code seems to break in preSubmit:
// Get the identifier for the row(s) currently being edited / removed.
var rowModifier = editor.modifier();
// Find the cell that is currently being edited
var positionObj = table.cell(rowModifier).index();
var guiInputStruct = table.row(positionObj.row).data(); // selected row
The guiInputStruct sometimes includes all the object's fields, and other times it doesn't.
The result is, cells do not retain the changes after the edit.
Any pointers as to what changed would be appreciated.
Answers
I think it will be the
submit
option in theform-options
object. How are you calling theinline()
method please?Allan
Hi Allan, I now have a better understanding as to why v1.7.4 is not working for me. As mentioned, my logic breaks in the
preSubmit()
.In v.1.6.1, the Data parameter contains this:
In v.1.7.4, it contains this:
You can see that the contents of the data field of the Data object parameter has changed. v.1.6.1 contains the field being edited and nothing else. v.1.7.4 contains the field being edited plus data from some of the other cells in the row - but not all all the cells.
My
preSubmit()
logic is checking for undefined when a cell was not was edited.By the way, is it possible that support for this has been dropped?
legacyAjax: true
What changed?
No - the legacy option is still supported. It sounds like some of the fields are being detected to have a different value when the form is submitted from when editing was triggered. There is another on going thread about this topic.
Could you add:
to your page please and let me know what the console shows when you edit a row with this issue and then submit it?
Thanks,
Allan
Allan,
Here are the results:
Note that my code has not been changed. I was just catching up on the DataTables and Editor updates.
Thanks. I fear I'm going to need to ask for a link to a test case with this one - are you able to PM me a link to the page?
Looking back you said:
The
guiInputStruct
from that code should use contain the data for the row being edited. It should never give any only a subset, unless the data for the row has been reduced to that subset.What's the pattern for this error? Does it happen on the second edit of the row? If so, that suggests that the full row information isn't being returned by the server. That is something that is now possible in 1.8.
Allan