Normally, after clicking the delete button in gridview, the record will be deleted and the page will refresh, but the page number in query string is lost. This is not always the case we expect.
Following is the table structure
CREATE TABLE IF NOT EXISTS `tblgroups` ( `id` int(11) NOT NULL, `groupname` varchar(150) NOT NULL, `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Acitve,2=Inactive', `date` datetime NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
If you want to give extra attention for some specific delete actions and you don't want to override whole yii.confirm JS method here is what you can do:
(I've only put the ActionColumn part of the GridView here to just give you the idea)
We will leverage Yii2-excelview widget. So, first of all is install Yii2-excelview:
One of the things you will find tricky to implement is the the sorting and filtering of a GridView's column that displays related model data.
This wiki explains how to add calculated fields into your Yii Framework 2.0 gridview with filtering and sorting.