Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi guys,

I have website in asp.net in which i'm using JQuery jqxGrid to bind data.

And successfully i bind the data.

In JqxGrid i have edit option also.
Now, i want to save all the data in SQL SERVER 2008 R2.

Code tried so far:
<script type="text/javascript">
        $(document).ready(function () {
            $("#btnSave").jqxButton();
            $("#btnSave").on('click', function () {
                var FID = $("#<%=hdnFID.ClientID %>").val();
                var Jobname = $("#<%=txtjobname.ClientID %>").val();
                var Discount = $('#<%=ddldiscount.ClientID %> option:selected').val();
                var index = 0;
                var a;
                var rowscount = $("#jqxgrid").jqxGrid('getdatainformation').rowscount;
                while (index < rowscount) {
                    var dataRecord = $("#jqxgrid").jqxGrid('getrowdata', index);
                    var a = FID + "|" + dataRecord.Ref + "|" + dataRecord.Ref + "|" + dataRecord.Quantity + "|" + dataRecord.TotalPrice + "|" + Discount;
                    //alert(a);
                    //FieldServiceTicket(a);
                    index++;
                }
                alert(a);
                //var saveXml = $("#jqxgrid").jqxGrid('xml', 'jqxGrid');
                //$("#<%=ltrsave.ClientID %>").text(saveXml);
                //alert(saveXml);
            });

            function FieldServiceTicket(a) {
                alert(a);
                $.ajax({
                    type: 'POST',
                    contentType: "application/json; charset-8;",
                    url: 'FST.aspx/SaveFST',
                    data: '{ Strdata:' + a + '}',
                    success: OnSuccess,
                    error: function (data) {
                        alert('Something went wrong !');
                    }

                });

                function OnSuccess(data) {
                    alert('Oho!');

                }

            }


        });
    </script>


can any one plz help me, how can i save jqxGrid complete data...

Thanks
Posted
Updated 3-Jun-15 4:09am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900