Skip to content

Commit

Permalink
Update Inplace editable docs with new events and template
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvanhieu143 authored Oct 15, 2024
1 parent 9f8458c commit af9e144
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/apis/subsystems/output/inplace.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class inplace_edit_select extends \core\output\inplace_editable {
$renderer = $PAGE->get_renderer('core');
$inplaceedit = new tool_mytest\local\inplace_edit_text($record);
$params = $inplaceedit->export_for_template($renderer);
echo $OUTPUT->render_from_template('core/inplace_edit', $params);
echo $OUTPUT->render_from_template('core/inplace_editable', $params);
```

</div>
Expand All @@ -284,7 +284,7 @@ $params = $inplaceedit->export_for_template($renderer);
```

```js title="The params are transferred via webservice and are then processed by JavaScript"
Templates.renderForPromise('core/inplace_edit', params)
Templates.renderForPromise('core/inplace_editable', params)
.then(({html, js}) => {
Templates.replaceNodeContents('nodeid', html, js);
return true;
Expand Down Expand Up @@ -325,7 +325,7 @@ Plugin page can listen to JQuery events that are triggered on successful update
```php
$PAGE->requires->js_amd_inline("
require(['jquery'], function(\$) {
$('body').on('updatefailed', '[data-inplaceeditable]', (e) => {
$('body').on('event:core/inplace_editable:updateFailed', '[data-inplaceeditable]', (e) => {
// The exception object returned by the callback.
const exception = e.exception;

Expand All @@ -337,7 +337,7 @@ require(['jquery'], function(\$) {

// Do your own error processing here.
});
$('body').on('updated', '[data-inplaceeditable]', (e) => {
$('body').on('core/inplace_editable:updated', '[data-inplaceeditable]', (e) => {
// Everything that web service returned.
const ajaxreturn = e.ajaxreturn;

Expand Down

0 comments on commit af9e144

Please sign in to comment.