Updating Select list in Editor popup container

Updating Select list in Editor popup container

JustereJustere Posts: 8Questions: 4Answers: 0
edited January 2015 in Editor

Hello,
I have 2 tables at one page.
In 1st table i able to work with data at column "titles", for example. Field type - default, text.
In second table i use exactly same column, but field type is "select".

The problem is:
When i change data in 1st table and go to second, the changes affects only on output table, in Editor popup it remains the same ( i.e there is no new records, or deleted are still exists ).

As i can understand, i need to somehow refresh data ( DataTable().ajax.reload() ? ) after record has been added, or after i switch to second table. (i use div tabs and able to bind some javascript at event ).

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited January 2015 Answer ✓

    Hi,

    Yes, Editor will trigger an update on a single table only. If you have two tables that are interdependent then you would need to trigger a refresh using ajax.reload() or similar. You could do that using the postEdit event.

    Allan

  • JustereJustere Posts: 8Questions: 4Answers: 0
    edited January 2015

    I already have done that week ago, by triggering refresh after event click at Tab.
    In JS console i can see, that it loads new data successfully.

    But there is no new data visual, idk why.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    I'm afraid I don't know either. I would need a link to the page to be able to debug the code.

    Allan

  • JustereJustere Posts: 8Questions: 4Answers: 0
    edited January 2015

    I'm so.. retarded.
    The Editor field data is not updated default, when ajax.reload is performed.
    The only way to change data in editor.fields is to do it manually, for example:

    $( "#refresh" ).click(function() {
            $.ajax({
                type: "POST",
                url: "lib/title_test.php",
                dataType:'json',
                success: function( options ){
                editor_block.field('block.id_test').update( options );
                    }
                 });
    }
    

    Thank you, Allan.

    Once again, convinced that existing topics on forum have inside answers to 99% of the basic questions asked.

This discussion has been closed.