M
M
My joy2019-02-05 13:03:32
Yii
My joy, 2019-02-05 13:03:32

How to remove pjax trigger when clearing select2 filter in GridView?

Hi friends!
If there is a select2 widget in the filter, and several values ​​are selected in it, then when clearing the filter (clearAll), for some reason it pulls data from the server as many times as the elements are cleared. in other words, after each removed element, it does onChange and the data is requested again. If 100 values ​​are selected, and click clear the filter - it will contact the server 100 times.
How can I make the filter changes applied after cleaning, and not after each removed element?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2019-02-06
@webinar

You can try to hook on pjax events: https://github.com/defunkt/jquery-pjax#events
You can add data-pjax=0 and then manually initiate pjax for this select

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question