2nd Editor in dialog seems unresponsive.

2nd Editor in dialog seems unresponsive.

CraigJCraigJ Posts: 28Questions: 12Answers: 2

I'm working on an application that uses Datatables to list some main entities. Upon selecting one and clicking "Edit" the form appears in a Bootstrap dialog with tabs. On one of these tabs is another Datatable with an editor. I have it set so that when the dialog is done loading ( Editor.on( 'open' ) ) the new Editor is instantiated, as is the new Datatable. This all seems to work properly - I can see the Ajax call to fetch and load the table, etc. When I select a row, the "Edit" button is enabled as expected. However, clicking the edit button does nothing, nor does delete or create.

You'll need a login to get to the page, I've emailed information on that as well as the DT debug info.

This question has an accepted answers - jump to answer

Answers

  • CraigJCraigJ Posts: 28Questions: 12Answers: 2

    Adding that I'm using the Editor PHP library - I can make any of the server side code available.

  • allanallan Posts: 49,501Questions: 1Answers: 7,286 Site admin
    Answer ✓

    Hi Craig,

    Many thanks for the e-mail with the link. Unfortunately, nested editing like you are trying to do is not something that Editor currently supports.

    What is actually happening is that the edit action is occurring, but the Bootstrap 4 display control contains this:

            if ( self._shown ) {
                if ( callback ) {
                    callback();
                }
                return;
            }
    

    So if the dialogue is shown (which it is for the top level form), it doesn't do anything - the second level form isn't displayed.

    It would be quite possible to have it just attach itself in, but then getting back to the previous level is not something I've yet considered for the API. It is planned for the future, but not yet implemented I'm afraid.

    Allan

  • CraigJCraigJ Posts: 28Questions: 12Answers: 2
    edited March 6

    OK, thanks, I'll need to figure something else out.

    Is there any reason that inline editing wouldn't work in the nested editor before I pursue that?

    I have this on the detail (nested) table in the ajax section:

    data: function ( d ) {
    //pass in parent id from main table
    d.parent_id = parent_id;
    }

    But in the ajax call I only see:

    action: edit
    data[row_1][description]: Item ABC aaa

    And the parent ID isn't passed

  • allanallan Posts: 49,501Questions: 1Answers: 7,286 Site admin

    Is there any reason that inline editing wouldn't work in the nested editor before I pursue that?

    Off the top of my head, no. But that is still nested editing, so its not something I've tried, nor is it supported I'm afraid.

    Allan

Sign In or Register to comment.