Yii2: Include View Specific JavaScript

To include JavaScript for specific action, either the JavaScript code or file is to be registered in view file. Method 1: Register JavaScript File Use registerJsFile(). Note: optional position. values: POS_HEAD, POS_BEGIN, POS_END. …

Yii2: Ajax Gridview

Want to navigate through the grids or trying to sort and filter data without waiting for the entire page to load? You need yii\widgets\Pjax and wrap it around GridView. In the view: …

Yii2: Typeahead widget

In Yii V1, you use CJuiAutoComplete widget which displays an autocomplete field. There’s equivalent widget in Yii2 but I’ve not tried it yet because I tried something developed by external parties before I knew …

Yii2: Export GridView

Export is not available from the built-in GridView widget. However there’s an enhanced GridView widget that include this functionality, along with many other features missing from the built in widget. …