PDA

View Full Version : How send several grid records in 1 Ajax Json request.



bryan10
18 Jan 2012, 12:40 AM
Hello,


I have created a grid with a checkbox column, as in the example
(Grid Plugins - grid 4) - the CheckboxModel has selectionchange
listener.
How do send all of the selected records to the server in 1 ajax,
json request? Is there an example?
With one record I could do record.save()...


I shall create a json writer and an ajax proxy on the model/store.


Thank you,
bryan

mitchellsimoens
18 Jan 2012, 6:20 AM
If you can get a list of the records you want I would iterate over them and build an array of objects and then send in an ajax call

Inaamullah
22 Nov 2018, 2:08 AM
If you can get a list of the records you want I would iterate over them and build an array of objects and then send in an ajax call
I want to send the multiple records to the server in Array of Objects Form

Bruno13
30 Apr 2019, 12:07 AM
Hi, maybe it can help you, I do like this to send several records.



var items = [];


var item = {
// Data
id : id_in_viewed,
relevance : relevance,
com : com,
};
items.push(item);


Ext.Ajax.request({
scope : this,
url : 'data/add.php',
method : 'POST',
jsonData : Ext.JSON.encode(items),
params: {
frombibsheet: true
},
success : function(response){


},
failure : function(response){


}
});