Answer the question
In order to leave comments, you need to log in
How to set up a GridView refresh without a full page reload?
Good afternoon, dear forum users.
I began to study YII2 intensively, it works well, but I stumbled while working with ajax requests and partial page updates.
I can't figure out how to update the widget's data...
Process automation in libraries:
There is one view on which there are 2 GridView::widget. In the first widget there is a list with a full name, in the second a list of books in the hands of a specific full name (id=id_name).
It is necessary to update the data in the second widget on a mouse click in the first widget.
jquery i process the click in the first widget and get the id. I don’t understand what to do next:?:
ps
I read a huge pile of manuals and articles.
Help to understand please.
Answer the question
In order to leave comments, you need to log in
wrap the second grid in a pjax container.
On the click event of the rows of the first grid, hang $.pjax.reload() in which you will pass the id of the current record
Well, my personal opinion is, if you want something simple, then yes GridView
if it’s already more deliberate - we take AngualrJs and do everything on it .. there are already all sorts of events and everything is delicious ... (put watch on the model ... - model changed, requested a code to replace the second model)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question