YII 2.0 GridView update

2019-04-08 14:27发布

I've got problem with updating yiigridview via javascript. I'm trying to use it yii 1.1 way:

jQuery.fn.yiigridview.update('grid-id'); 

but this gets me the error: 'undefined is not a function' How to update the whole GridView widget (or only one row) in Yii framework 2.0 using javascript?

标签: gridview yii2
2条回答
女痞
2楼-- · 2019-04-08 15:00

I have found solution here http://www.yiiframework.com/wiki/655/how-to-use-gridview-with-ajax/ Using pjax:

$.pjax.reload({container:'#idofyourpjaxwidget'});
查看更多
疯言疯语
3楼-- · 2019-04-08 15:13

You may also use Yii2 callback:

$("#your-grid-id").yiiGridView("applyFilter");
查看更多
登录 后发表回答