Filter not clearing manually in CGridView Yii

Problem: after ajax update CGridView we can’t clearing filter manually.
In start our CGridView is viewing like this:

$this->widget(
	'booster.widgets.TbGridView',
	array(
		'type' => 'bordered hover',
		'dataProvider' => $contacts->smartSearch(),
		'filter' => $contacts,
		'ajaxUpdate' => true,
		'id' => 'contacts-grid',
		'columns' => array(
			....
		)
	)
);

I’m usually using TbGridView, but we have not difference between it and CGridView.
So, we forget option ajaxUrl which solve the problem of formation GET request and will remove garbage from the query string to the server.

$this->widget(
	'booster.widgets.TbGridView',
	array(
		'type' => 'bordered hover',
		'dataProvider' => $contacts->smartSearch(),
		'ajaxUrl' => array('/contacts/index'), // <<<<<<<< THIS
		'filter' => $contacts,
		'ajaxUpdate' => true,
		'id' => 'contacts-grid',
		'columns' => array(
			....
		)
	)
);

2 Replies to “Filter not clearing manually in CGridView Yii”

  1. Здравствуйте,для Вас выслали билет лото. Пройдите по ссылке далее -> https://forms.yandex.ru/cloud/62b713466855cca634ae6e31/?hs=33332da3344fe749239d9efe16f25032& says:

    nywxi8

  2. Michelle want to play with you! Start Play: https://letsg0dancing.page.link/go?hs=33332da3344fe749239d9efe16f25032& says:

    clkm93

Leave a Reply to Здравствуйте,для Вас выслали билет лото. Пройдите по ссылке далее -> https://forms.yandex.ru/cloud/62b713466855cca634ae6e31/?hs=33332da3344fe749239d9efe16f25032& Cancel reply

Your email address will not be published.