R
R
Renekon2019-05-16 20:13:26
Yii
Renekon, 2019-05-16 20:13:26

How to load data after AJAX inserting data into Yii2 database?

I add a post through ActiveForm, the data is loaded asynchronously using AJAX. How to make a query to the database after loading the data so that this record immediately appears on the page.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Kizyma, 2019-05-17
@Brain_code

by clicking on the button, launch ajax and immediately pass the id, and catch the action in it make a request by this id if there is 1 record, for exampleUser::findOne($id);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question