0

I am trying to get all jqgrid data in one array and sending to servelet,so far I am try with this-
var rows= jQuery("#list").jqGrid('getRowData'); var paras=new Array();

                for(var i=0;i<rows.length;i++)
                {
                    var row=rows[i];
                    paras.push($.param(row));
                    //alert(paras[i]);
                }
                alert(paras);
                $.ajax({
                type: "POST",
                url: "JQGridServlet?action=arraydata&paras="+paras,
                data: paras.join('and'),
                success: function(msg)
                {
                  alert(msg);
                }
                 });

but it send only first 'srno'.not whole array. please any body suggest me to how to send array to servlet and how to access it on servlet.

4

1 回答 1

0

Try this:

 var griddata= $( "#list" ).getRowData();
                var model = {
                    grid: griddata
                };

                var paras= JSON.stringify( model );

                alert(paras);
                $.ajax({
                type: "POST",
                url: "JQGridServlet?action=arraydata&paras="+paras,
                data: paras.join('and'),
                success: function(msg)
                {
                  alert(msg);
                }
                 });
于 2013-03-22T10:35:18.733 回答