I want to append a parameter to the auto generated parameters of filtermodel in GridView
How do I add additional parameters?
-
1Which url are you talking about ? . Can you share some code and specify where does this url appear in you code ?ck_arjun– ck_arjun2016-03-15 07:48:52 +00:00Commented Mar 15, 2016 at 7:48
-
for exam this is url that generate when we use filter in grid view localhost/reserve/hours-list?HourSearch%5Bgender%5D=men , but i want to append a parametr like "&date=2016/3/15" to endof this url !user2564443– user25644432016-03-15 07:59:07 +00:00Commented Mar 15, 2016 at 7:59
-
So everytime the filtering actions occur u need to pass additional parameters to your controller action right ?? .ck_arjun– ck_arjun2016-03-15 08:39:41 +00:00Commented Mar 15, 2016 at 8:39
-
Is this parameters view specific ?, i mean if these parameters are dynamic like todays date , we dont need to pass it to controler action. But can be directly used in controllerck_arjun– ck_arjun2016-03-15 08:41:00 +00:00Commented Mar 15, 2016 at 8:41
-
Thanks So Much ,filterUrl works !user2564443– user25644432016-03-15 09:08:36 +00:00Commented Mar 15, 2016 at 9:08
Add a comment
|
1 Answer
You can use 'filterUrl' property of GridView
In your GridView
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'filterUrl' => ['YOUR_CONTROLLER_ACTIONID_HERE','date' => date('Y-m-d')],
'columns' => [
],
]); ?>
first parameter to 'filterUrl' is your action id. After that you can give your additional url parameters as key value pair