How can I, reload only grid-view on on change event of drop-down in Yii2?
I know that it can be done via pjax but not sure where and how to use the code.
I am using Ajax request for communicating with controller. Here is the ajax code:-
function loadGrid(level) {
alert(level);
$.ajax({
type: 'GET',
url: 'index.php?r=villagedata/level',
data: {level:level},
success: function(data)
{
alert("Success");
$.pjax({container: '#myview'});
}
});
}
I wan't my grid to reload when the Ajax Request returns success message.
Thank You.