Category: ajax

How can I process a form treatment in background and display a message to the user on submit in Symfony 4 (PHP)

I have a form which has an execution time of about 10 minutes. I want to display a message to the user on submit while the execution as been done in background to avoid the user to wait for it…

Delete with Ajax From PersistCollection (SonataAdmin)change of ids when saving in the database

I have an Array PersistCollection list of Sonata , after delete action with an Ajax request (remove tr in the DOM part),when i control the table the ids are correct but after saving the data,(page of edit) the ids in…

get FormData call ajax to symfony 4

My code js is: fetch(img).then(response => response.blob()) //img is canvas with method toBlob(‘image/png’) .then(blob => { console.log(blob) const fd = new FormData(); fd.append(“fileName”, blob, “file.ext”); return fetch(“/sendImg”, { method: “POST”, fd }) }) .then(response => response.ok) .then(res => console.log(res)) .catch(err…

Symfony DataTables return database in ajax.text format

I’m using DataTables in my symfony project to render a table with database info like this: <tbody> {% for file in files %} <tr> <td>{{ file.name }}</td> <td>{{ file.primaryCat }}</td> <td>{{ file.secondaryCat }}</td> <td>{{ file.postedAt}}</td> <td>{{ file.tags }}</td> <td>{{ file.location…