Answer the question
In order to leave comments, you need to log in
How to filter results in CGridView not only by pressing enter?
Good afternoon! Problem following: Is with the data + filters. The date filter works through the YiiBooster widget - TbDateRangePicker. The problem is that the filter should work when a date is selected (by clicking), i.e. I chose the date - "For this week", and the grid should be updated immediately, but now it works only after pressing the enter button.
That is, I chose a value (date), this date is substituted in the field and nothing is filtered until you press enter. There is some 'callback' parameter in the widget output code, I inserted the $.fn.yiiGridView.update() function with the grid id there, and the function works, but does not send the form data, i.e. just makes ajax request without data :). How to be, it’s not clear, I’m very, very new to Yii ... I’m
attaching a filter screen by date, so that it’s roughly clear what I’m talking about:
Answer the question
In order to leave comments, you need to log in
Try this callback
You need to re-initialize the daterangepicker plugin to make it work again. It's
done like this
In the grid settings
And after or before the grid
Yii::app()->clientScript->registerScript(
'reinstall','
function reinstallDatePickers(id,data){
$("#Orders_created").daterangepicker({настройки грида}, function(){
$(this.element).change();
});
');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question