I have a view with a gridview with checkboxcolumn and a google-map (2amigos). The user selects the machines to display in the map by selecting the corresponding items in the gridview. A html-button submitts the selected keys to the controller. Following the controler code (dataProvider gets updated by post-request):
//some code before render
$dataProvider = new ActiveDataProvider(['query'=>$query, 'pagination'=>false]);
return $this->render('locating', [
'model' => $model,
'searchModel' => $searchModel,
'dataProvider1' => $dataProvider1,
'dataProvider' => $dataProvider,
]);
}
And this is the js-script for the html-button:
$('#showButton').click(function(){
var keys = $('#w0').yiiGridView('getSelectedRows');
$.post("http://localhost:8080/eddb1/frontend/web/index.php?r=tracking/locating",
{'keylist': keys},
function(data){
console.log(data);
});
});
The problem is, that with the post request the result of php-render command gets writen as a html-string to the post-response but the view doesn't get re-rendered. If I do the same with an activeForm instead of a gridview (to select the machines) and a submit-button the page gets re-rendered as it should (but this way doesn't work for me because I need the gridview with filter and sorting). What can I do that the map (or the view) gets re-rendered with the post-request?