How can I send the igGrid datasource to the Controller action MVC 3?
Thanks
Hi,
yes sounds correct. Thanks
Angel
The datasource is json, but for some reason when I called the grid datasource.data() it returns an array of objects. I can see the array of object in google chrome javascript console.
I was able to get the data to the server using the following line of code. The trick was to use JSON.stringfy function, which is the same function that the grid uses when calling savechanges.
$.ajax({ url:
"/SaveGridData/", data: JSON.stringify(dataSource), type: 'POST', contentType: "application/json, charset=utf-8", dataType: "json"
});
Please let me know if this sounds correct to you.
Thank you so much for your help.
in what format is the data you are passing? the $.post / $.ajax expects array of javascript objects. it will do the serialization for you.
Thanks,
I think the problem is that I need to convert the datasource (array of objects) to json array. How do I get the datasource in json format?
I tried your suggestion, but when the message gets to the server is said undefined. Do you know why the message is undefined?
var dataSource = $('#grid1').data('igGrid').dataSource.data();
$.ajax({ type: