M
M
Maxim Lagoysky2018-10-11 12:03:54
JavaScript
Maxim Lagoysky, 2018-10-11 12:03:54

How to update GridView from javascript?

Good afternoon everyone, there is such a question, there is a GridView and there is an ajax request, this ajax request returns a dataProvider for the GridView. The question arose whether there is a js function to update the entire GridView according to the new dataProvider that came from the answer? Please, not a word about pjax, everything works for me through pjax. I'm interested in the answer to just this case. Perhaps there is a function to create a completely new GridView?

$("куда то кликаем").click(function (event) {
       event.preventDefault();
      $.ajax({
           url: this.href,
           type: "POST",
           data: $('.form-search').serialize(),
           success: function (response) {
                //что сюда надо? в response находится dataProvider
           }
       });
   });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Shevchenko, 2018-10-15
@densisss

In yii gridView is formed using php. So what to do through js will not work. There are js libraries for building tables, but this is completely different.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question