OctoberCMS Ajax Sort in the frontend OctoberCMS Ajax Sort in the frontend ajax ajax

OctoberCMS Ajax Sort in the frontend


If you want to pull in the partial updates from the handler, then the attribute name should be

data-request-update="resultsPartialName: '#results'"

You can use multiple partials also like this:

data-request-update="firstpartial: '#myDiv', secondpartial: '#otherDiv'"

The other way to go is to push the partial updates from the ajax handler. This feels a bit cleaner to me, but its is just the matter of preference.

function onRefreshTime(){    return [        '#myDiv' => $this->renderPartial('mypartial')    ];}

More info in the Updating partials page of the official documentation.


Change into default.htm if default.htm in a folder, then replace data-request-update="foldername/default:'#results'"

<form data-request="{{ __SELF__ }}::onFormSubmit" data-request-validate><button class="btn btn-default" data-request="onHandleForm" data-request-update="default:'#results'"></form>