Editor isn't updating values on the page (DOM)

Editor isn't updating values on the page (DOM)

stevevancestevevance Posts: 58Questions: 6Answers: 1
edited August 2017 in Free community support

When you use the standalone editor (manual) the values on the page that were displayed before you edited them are supposed to change to the new, edited values, as long as you have the data-editor-field on an HTML element.

That's not happening for me. The values on the webpage are the same as they were when the page loaded. I am using v1.6.3.

You can test it live.

Whatever edited data you submit in the form, I've set it up so the server sends back this data:

{"data":[{"DT_RowId":"row_9999","id":9999,"first_name":"Steven (hey)","last_name":"Vance (hey)","organization":"This should show","pause_emails":false}]}

Replies

  • stevevancestevevance Posts: 58Questions: 6Answers: 1

    I figured it out by wrapping the <dd> elements with a <div> that has the attribute data-editor-id="row_XX, where XX is the database row's ID.

    Here's the full HTML:

    <div id="edit_profile" data-editor-id="row_<?php echo $userClass->data['id']; ?>">
                            <dl class="dl-horizontal">
                                <dt>First name:</dt>
                                <dd data-editor-field="first_name"><?php echo $userClass->data['first_name']; ?></dd>
                                <dt>Last name:</dt>
                                <dd data-editor-field="last_name"><?php echo $userClass->data['last_name']; ?></dd>
                                <dt>Organization:</dt>
                                <dd data-editor-field="organization"><?php echo $userClass->data['organization']; ?></dd>
                                <dt>Pause emails:</dt>
                                <dd data-editor-field="pause_emails" data-editor-value="<?php echo $userClass->data['pause_emails']; ?>"><?php echo $userClass->data['pause_emails'] == true ? "Paused" : "Not paused"; ?></dd>
                            </dl>
                        </div>
    
  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    Perfect - thanks for posting your solution!

    Allan

This discussion has been closed.