如何防止Yii CGridView过滤器改变?
问题描述:
CGridView have active filter with "change" event. So every time i type something in one filter and leave this field it will change results on list.
I want to prevent this behavior and make CGridView filters only when user hits "enter" key.
So i could type values in 3 different filters and then hit enter to show results.
How can i do that?
CGridView具有带“更改”事件的活动过滤器。 因此,每次我在一个过滤器中输入内容并离开此字段时,它将更改列表中的结果。 p>
我想阻止此行为并仅在用户点击“输入”键时生成CGridView过滤器。 p>
所以我可以在3个不同的过滤器中键入值,然后按回车键显示结果。 p>
我该怎么做? p> \ n div>
答
Try
$(document).off('change.yiiGridView');