PJax not pass form data

Hello,

In YII 1.0 when I call $.fn.yiiGridView.update to update a cGridView the form data is pass in request of the GET method, but in YII 2.0 I have to use $.pjax.reload function to reload the GridView data, but the form data request is not pass to the GET.

How can I do to pass the form data with $.pjax.reload?

Thanks

Hi,

Nobody can help me with this?

Why is so hard to work with ajax in Yii2?

Hello Jacques,

You can use pjax to post data like this:





var options = {

            type: 'POST',

            url: $('#form_id').attr('action'),

            container: '#pjax_widget_id', // id to update content

            data: $('#form_id').serialize()

        };

        $.pjax.reload(options);



Hope this help you.