Thanks Edin. It helped me to solved the problem. Here is what I did. It might help someone facing the same problem. As Edin mentioned you need to pass the url along with the search parameters to the Pjax in order to refresh the gridview. Here's my edited code :...
php,ajax,yii2,pjax,active-form
Managed without $.pjax, just added this $("#risks-solutions_order-sortable").append('<li data-id="'+data.id+'" data-key="'+data.id+'" draggable="true">'+data.solution+'</li>'); $("ul[id$='sortable'").trigger('sortupdate'); $('#risks-solutions_order-sortable').sortable( "refreshPositions" ); in ajax success and everything is ok! :)...
javascript,php,gridview,yii2,pjax
If I understood properly you don't need 3 dataProviders. You should use GridView's FilterSelector option to treat that external element as part of GridView's filter. For example echo GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'filterSelector' => "input[name='ModelSearch[_selection]'],", ... Then, in your Filter Model you filter depending on that value...
Try to change that last line to JacobBennett\Pjax\PjaxMiddleware::class ...
javascript,preloader,pjax,smoothstate.js
I'm no expert, but while both handle the post event via AJAX, I think smoothState.js has more of an emphasis on creating animated transitions. smoothState.js gives you access to three functions that allow you to easily insert animations into a page load, making the transition completely smooth: onStart - Run...
Pjax widget is included by default, no need to additionally install it. Your problem is related with namespaces. Either specify full namespace in use section: use yii\widgets\Pjax; and then use it as Pjax. Or specify full namespace with leading back slash like so: \yii\widgets\Pjax. Using first option most of the...
From the Turbolinks Readme: You can use Turbolinks.visit(path) to go to a URL through Turbolinks. ...
javascript,php,jquery,yii2,pjax
I figured it out. Here's my updated code: HTML <div class="table-responsive all"> <?php \yii\widgets\Pjax::begin(['id' => 'reimbursement_grid']); ?> <?php echo $this->render('_index', ['dataProvider' => $dataProvider ]); ?> <?php \yii\widgets\Pjax::end(); ?> </div> JAVASCRIPT <script> //$(document).ready(function(){ $(document).on('ready pjax:success', function(){ $('input[type=radio]').prop('name', 'filter'); var showAll = $('input[name=filter]').val(); if(showAll == "Show All") {...
I believe you need to use pjax:success. This should give you the data object. $(document).on('pjax:success', function( event, data, status, xhr, options ) { $('#content').imagesLoaded(function(){ $('#content').masonry('reloadItems').masonry(); }); var $newPosts = $(data).find('.entry'); var $newPostIDs = $newPosts.map(function () { return this.id; }).get(); Tumblr.LikeButton.get_status_by_post_ids($newPostIDs); }); Source: https://github.com/defunkt/jquery-pjax#events...
Try using post method of Pjax: $.pjax.reload({url: url, method: 'POST', container:'#bank-grid'}); ...