N
N
nepster-web2014-03-13 20:17:14
Yii
nepster-web, 2014-03-13 20:17:14

Yii2 content update using ajax, how to implement?

For example, there is a news module, it has an action all news , in the view of which all the news in the table should be displayed.
Each news item has a delete icon. When I click on the icon, my modal window opens with a warning about deletion, and then after clicking on the OK button (in the modal window), I need to delete the corresponding news and update the entire news table using ajax, please tell me how can I implement this in Yii2?
I worked with Yii1, but I did such a thing with my own scripts, I would like to learn how to do ajax content update using the framework tools.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-03-13
Protko @Fesor

It seemed to me that CGridView was able to do all this since version 1.1

Y
Yuri Morozov, 2014-03-13
@metamorph

You want to look at the data-confirm attribute (which doesn't seem to be documented, but it's awesome) and pjax (which seems to have been pushed to master recently)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question