How to submit a functional Editor test case
How to submit a functional Editor test case
Link to test case:
http://live.datatables.net/quhacego/1/edit
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
I would like to submit a bug report but it can only be shown using a full edit cycle.
I started an example but could not find a way to point to a live data source for data retrieval and edit.
I saw the links as the bottom of this announcement but they did not work as expected.
https://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read#latest
I used the inline editor as the starting point for my example.
https://editor.datatables.net/examples/inline-editing/simple.html
I attempted multiple data URLs:
1) Pointing to the URL used by the main site triggers a CORS error,
2) Using the URLs in the downloaded examples also fails
This question has an accepted answers - jump to answer
Answers
With those scripts it's better to use the data in the DOM. You should be able to use this as a starting point here: http://live.datatables.net/mohohaya/1/edit
Colin
Hello Colin, thanks for that example but unfortunately I need the full server round trip.
The issue I "think" I have found is that the result from the following two ways of getting the table data change after doing an edit. Before the edit the results are returned as an array, after they become an object.
It is possible this is only the case when the data is server side.
When not serverside the results are always an object so I suspect that is what is now intended. This change caught me off guard.
Yes, that is going to cause problems. The row data format returned by an edit / create command must be the same as the table’s data when it was first loaded. The value is passed straight to the DataTable, so if it is expecting an object for the row, and you give it an array, then it will fail.
Perhaps you can show me your initialisation code and the data initially loaded and also the data on edit response?
Allan
Hello Allan,
My server data is returned using an array but the edit structures are an array of objects as specified in the documentation. Should I be returning the edit data as an array as well?
My application was build using the following example as starting point.
https://datatables.net/examples/server_side/simple.html
A sample data set is:
Edit response was based on https://editor.datatables.net/manual/server:
Configuration code is: aqagez
The field names are "0" -> "4".
Yes. 99% of Editor use cases use objects rather than arrays since it is easier to keep track of property names rather than array indexes (particularly if you add or remove a column) - which is why the documentation focuses on that almost exclusively, but you can also return an array of data in the
data
array on edit.Allan