editor crash in .on('xhr.dt.dte' + this.s.unique, function (e, settings, json)
editor crash in .on('xhr.dt.dte' + this.s.unique, function (e, settings, json)
Lapointe
Posts: 430Questions: 81Answers: 4
in Bug reports
Datatables.editor.js 2.0.10 run OK... testing if json
.on('xhr.dt.dte' + this.s.unique, function (e, settings, json) {
** if (json && _this.s.table && settings.nTable === $(table$1)[0]) **{
// Automatically update fields which have a field name defined in
// the returned json - saves an `initComplete` for the user
_this._optionsUpdate(json);
}
});
Datatables.editor.js V 2.1.0 NOK... If json is null, system crash (row 6693)
.on('xhr.dt.dte' + this.s.unique, function (e, settings, json) {
var table = _this.s.table;
if (table) {
var dtApi = new DataTable.Api(table);
if (settings.nTable === dtApi.table().node()) {
// Automatically update fields which have a field name defined in
// the returned json - saves an `initComplete` for the user
_this._optionsUpdate(json);
}
}
});
Replies
Can you show me how you have configured your Editor instance, and any events you have attached to it please? Or even better, can you give me a link to the page so I can take a look please?
Thanks,
Allan
hi Allan
As I said release 2.1.0 crash with a problem when option list is null so no json is returned (null)
It was when browsing a table and editing rows. Some of them were ok and other not.
I'm just afraid for deploying
I'll give you a pwd in private mode to test.
Hi all
I do test in r2.2.2. The problem does not exist anymore
To confirm. The whole JSON on data load is null, the
options
object, or the specific field's options array/object?Allan
Yes Allan... JSON === NULL
in V2.0.x, JSON value was tested, in 2.1.0 not...
In our Ajax complete handler (for Editor, not DataTables) there is a test for the return being
null
(note as a string, not a "true" null).That was actually in 2.1.0 though.
Allan
hi allan
dataTables.editor.js, 2.1.0
line 6693
line 4218
So function is called with no test for json is null, and when calling json.options, error occurs if json is null
Please let me know where I missunderstood
Thank for all
Bob
Bob
I'm with you now. Thanks for the clarification. The fix for that was in Editor 2.1.1:
Allan