CakePHP display updated table of data using ajax - ajax

I'm having real trouble finding any documentation on this.
I have a page that displays a list of users, above this i can edit the users successfuly with ajax. After the update, i want the table below to be updated with the new information.
How do i go about doing this? I'm thinking i need some sort of view that displays the data in a table, and i want to get that view's contents and inject it into my page, but i can't seem to find out how?
Can anyone point me in the right direction please

Put users table in div id like "Users" and do something like following in edit ajax success function call
$("#users").load("same_page_url #users");

Related

Laravel Backpack Update Datatable via ajax when select field change

i am new to laravel backpack. I have a view where i have to show some details of a category, i have a dropdown list of categories on top and datatable below it listing all the details i want to update this data table when any category is selected and I want it use ajax so that it wont load the page again. I was unable to get any clue in the documents. Can someone point me to the correct way to implement this. Thank you in advance!
In Laravel backpack v4 as far I know you can use the variable crud and by calling this crud.table.draw()
You can see the file in datatables_logic.blade.php.
JQuery(document).ready(function($){
crud.table = $("#crudTable").DataTable(crud.dataTableConfiguration);
...
)}

How to load datatable on change of dropdown

I have a view where there is a dropdown and datatable.
At initial load, I am loading the values to be loaded in the datatable based on the first select of dropdown and on change of dropdown, I want to fetch data based on that condition and populate those data on the datatable.
Please anyone suggest a way to do this!
I am trying a way using get request but it is reloading the page and hence I am unable to make the data persist in the datatable.
I followed exactly this https://laracasts.com/discuss/channels/laravel/filtering-data-using-drop-down-onchange-event
Data is coming and populates to the datatable but just after a second, it reloads and comes to old data in datatable.
Please either correct my or suggest some new way to do it!
After debugging, I found that in one of the js file included, there were a code
$(document).ajaxStop(function() {
window.location.reload();
});
Since, this code was making it to reload on every ajax call completes, I faced this issue.

How to reload row in datatables

I have read many posts that talks about this but still I cannot find a clear answer to my question
I need to reload only 1 row when I click on a button
At the moment, I send an ajax request to the server that change a boolean value. The request change the db field but not the table obviously. Now I need to refresh the corresponding table field which is row specific.
$('#table').DataTable().ajax.reload();
This works but it is not quick enough
How can I refresh only the row where the modification happens. Even better if I can refresh only the specific field within the row
Something like this:
$('#table').DataTable().row(rowNumber).data();
I have read that I need to send an ajax request that give me the updated value and put it in the field. I know already what to put but how can I refresh the specific field?
Can you please show me an example
I am using dandelion datatables 1.1.0

Search View For Admin In magento

I have created a Sample Module (Admin Side) in Magento.. I managed To created a form and Then Stored the form field values in Database. Now I am trying To create a search view for that. to show me all the values which i have stored in my table. however i am not able to get it. when i press the tab I directly get the form view. I want the search view first and a button there which ll direct me to this form. I want it the same way as it is for product, category or any other module. Do anyone Know How can I do it.
It's called a grid. The process is kind of long to explain here, but if you search online there are a few tutorials that explain how to do it (here's one that I found useful: http://www.webspeaks.in/2010/08/create-admin-backend-module-in-magento.html). Keep in mind that you can also model your own code after core code. If you want to make a grid like the Category grid, then go look in the code how its made.

Updating data with information received from the view (Grails)

I am writing a Grails app and I have a quick question about the best way to do something. My controller has 2 lists of data, both of which are displayed on the view in separate HTML tables. What I want to do is to have a button that will allow you to move an item from one list to the other. What is the best way to do this?
I have done some research and using some form of AJAX seems to be the general consensus on the best way to do this. Is there any other way? The heart of the problem is that I can't figure out how to update the data contained in the contoller based on the button the user presses in the view.
Thanks
I solved this by just updating the model to reflect the new lists and rerendering the page

Resources