Editor buttons are not working twice. Why?

Editor buttons are not working twice. Why?

danwosdanwos Posts: 7Questions: 2Answers: 0
edited May 2016 in Free community support

Hi all,

after using the editor buttons to create, edit or delete, I'm no longer able to use them again to open the editor.

jsfiddle:
http://live.datatables.net/qisaxiju/20/edit?js,console,output

This only happens, if I click the Create/Update/Delete button inside the popup.
If I close the popup via "x"button on the upper right corner, I'm able to reopen it again.

The used ajax-urls do not exist, so you must abort the transaction after you clicked the create, update, ... button.
But the behavior is the same, you are not able to reopen the editor again.

I have added a small button "Test-Edit" so that you are able to open the editor via this button. This also works after a transaction was aborted. But the shown popup always contains the data of the last edit row. Even if you have selected another row.
If no edit was executed before, the test-buttons opens the editor with the expected data.

I suppose that I do not handle editor-closing correctly and I'm missing some important steps.

Any ideas?

Daniel

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,175Questions: 1Answers: 10,409 Site admin

    This normally happens when the returned data from the server is not in the expected format.

    What is the JSON data that your server returns?

    Allan

  • danwosdanwos Posts: 7Questions: 2Answers: 0

    There is no return data.
    Normally only a http status code, which is 200, if everything was ok.

    I will check your linked spec tomorrow and see, if I can adjust my backend to provide such return data.

    But nevertheless, is there no way to specify own functions, which handle the return data?
    I'm using a REST API, which interface is somehow "frozen" and reused by other applications as well. So if specific return data is needed, this needs so be solved by an additional, internal API... :-/

    To understand you right: if the return data is not valid, missing or somehow corrupted, the mentioned behavior is the normal case? So a reload of the page would be the best solution, if return data is invalid?!

    More tomorrow.

    @Allan: As always thanks for the fast answer :)

    Daniel

  • allanallan Posts: 63,175Questions: 1Answers: 10,409 Site admin
    Answer ✓

    There is no return data.

    That would do it - I'm afraid Editor currently requires that the server return information about the row that was editing. This is to cover the use case of server-side data being updated (for example an "updated" time stamp, or "last updated by" field).

    The plan is to relax that constraint with Editor 1.6 so that the server need only return some of the edited data (or none).

    So yes - at the moment, Editor fundamentally requires the data interchange format that is described in the manual.

    Regards,
    Allan

This discussion has been closed.