Skip to content

Commit af9e144

Browse files
authored
Update Inplace editable docs with new events and template
1 parent 9f8458c commit af9e144

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/apis/subsystems/output/inplace.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ class inplace_edit_select extends \core\output\inplace_editable {
266266
$renderer = $PAGE->get_renderer('core');
267267
$inplaceedit = new tool_mytest\local\inplace_edit_text($record);
268268
$params = $inplaceedit->export_for_template($renderer);
269-
echo $OUTPUT->render_from_template('core/inplace_edit', $params);
269+
echo $OUTPUT->render_from_template('core/inplace_editable', $params);
270270
```
271271

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

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

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

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

0 commit comments

Comments
 (0)