Myke623
Well-known member
I'm trying to get a handle on inline editing with basic formAction rather than creating Services. The approach I'm using is similar to Profile Posts, so there's a basic form followed by a feed of messages. Inserting messages via ajax works fine, and messages can be edited inline. The issue I'm having is that after saving an inline edit, the reply being returned (via ajax) is showing up empty rather than the view I've specified. The actual edit and save is successful though, verified with a page refresh.
When inspecting the html after the inline save, the following empty div is rendered:
The
My relevant controller code is as follows:
I'm not sure why my view (
When inspecting the html after the inline save, the following empty div is rendered:
HTML:
<div class="message-cell message-cell--main is-editing"></div>
The
is-editing
class gets inserted during the inline edit, and seems to be stuck there after the save.My relevant controller code is as follows:
PHP:
if ($this->isPost())
{
$input = $this->filter('note', 'array');
$form = $this->formAction();
$form->basicEntitySave($note, $input);
$form->run();
if ($this->filter('_xfWithData', 'bool') && $this->filter('_xfInlineEdit', 'bool'))
{
$viewParams = [
'note' => $note,
'noInlineMod' => $noInlineMod
];
//var_dump($note);
$reply = $this->view('Demo\Scratchpad:EditNewNote', 'demo_scratchpad_edit_new', $viewParams);
$reply->setJsonParam('message', \XF::phrase('your_changes_have_been_saved'));
return $reply;
}
else
{
return $this->redirect($this->buildLink('scratchpad'));
}
}
I'm not sure why my view (
demo_scratchpad_edit_new
) isn't being returned at all. Any ideas?