Ad
OctoberCMS Partial Not Updating
I have an issue returning a partial update from ajax call
$.request('onClientChange', {
data: {thisClient:thisClient},
update: {sessionlist: '#sessionlist'},
success: function() {
//alert(' Made it');
}
});
The handler onClientChange looks like this
function onClientChange(){
$currentClient = post('thisClient');
$this['currentClient'] = $currentClient;
$sessionSql = "SELECT * FROM hdl_sessions where ClientID = $currentClient";
$sessionDataset = $this->fetchData($sessionSql);
$this['sessionDataset'] = $sessionDataset;
}
The data returns directly to $sessionDataset and looking at the network tab in Chrome, I can see the partial data (an updated table structure) returning via the XHR log. The HTML table data renders fine statically when pasted into a blank page. It doesn't appear in the div marked by the ID
<div id = "sessionlist" class = "table-responsive">
{% partial "sessionlist" %}
</div>
Any help gratefully received
Ad
Answer
use complete function instead of success function in javascript API
$.request('onClientChange', {
data: {thisClient:thisClient},
update: {sessionlist: '#sessionlist'},
complete: function() {
//alert(' Made it');
}
});
Ad
source: stackoverflow.com
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
Ad