Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Pwavel

Pages: [1]
1
i tried
dataModel = {
 location: "remote",
 method: "POST",           
 getUrl: function () {
             
                var getObj = {
                    url: "jquerygrid.aspx/GetCustomers",
                    data: data
                };
                return getObj;
            },
            getData: function (dataJSON) {                               
                return { curPage: dataJSON.SelectedPage, totalRecords: dataJSON.TotalRecord, data: dataJSON.data };
            }
        };
and also this
 dataModel: {
                        beforeSend: function (jqXHR, settings) {
                            jqXHR.setRequestHeader("Content-Type", "application/json");
                        }
                    }
my web method is as follows
        [System.Web.Services.WebMethod]
        [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
         public static string GetCustomers()
        {
            string query = "SELECT * FROM tr";
            SqlCommand cmd = new SqlCommand(query);

           
            DataSet data = GetData(cmd);
            string strjson = GetJson(data.Tables[0]);
            return strjson;
      }
the only difference here is instead of method:"Post" i have method:"Get".Thats it..
Is anything wrong i m doing or missing something.Why am i still not able to call my webmethod

2
my colM is
var colM = [{ title: "ACVRNO", width: 190, dataType: "string", dataIndx: "ACVRNO" },
                { title: "ACSLNO", width: 160, dataType: "string", dataIndx: "ACSLNO" },
                { title: "CODEDR", width: 160, dataType: "string", dataIndx: "CODEDR" },
                { title: "CODECR", width: 160, dataType: "string", dataIndx: "CODECR" },
                { title: "AMOUNT", width: 160, dataType: "float", dataIndx: "AMOUNT" },
                { title: "VRDATE", width: 160, dataIndx: "VRDATE" }];
I have changed from datajson to datamodel but its still not able to get data from function .Help Me...

3
i want to use the following

  var dataModel = {
                    location: "remote",
                    sorting: "remote",
                    paging: "remote",
                    dataType: "JSON",
                    method: "GET",
                    curPage: 1,
                    rPP: 20,
                    sortIndx: 0,
                    sortDir: "up",
                    getUrl: function () {
                        var sortDir = (this.sortDir == "up") ? "asc" : "desc";
                        var sort = ['ACVRNO', 'ACSLNO', 'CODEDR', 'CODECR', 'AMOUNT', 'VRDATE'];
                        return {
                            url: "jquerygrid.aspx/GetCustomers", data: "cur_page=" + this.curPage + "&records_per_page=" +
                                this.rPP + "&sortBy=" + sort[this.sortIndx] + "&dir=" + sortDir
                        };
                    },
                    getData: function (dataJSON) {
                        return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: dataJSON.data };
                    }
                }

 var grid1 = $("#grid_parts").pqGrid({
                    width: 900, height: 350,
                    dataModel: dataJSON,
                    colModel: colM,
                    resizable: true,
                    columnBorders: true,
                    freezeCols: 2
                });

i m not able to get data from the page jquerygrid.aspx which has GetCustomers webmethod which returns data that i want to display in grid.How to call this method and get the data that i want?

4
Help for ParamQuery Grid (free version) / how to use getUrl function
« on: January 14, 2014, 02:42:16 pm »
 I want to use the below function in an asp.net page. But i m not able to understand what  url: "/demos/pagingGetOrders" stands for.is "pagingGetOrders" name of a function which returns data or is this the path for a text file or an xml file or something like that.
Can i get the data from a c# function using this method by just giving the name of page and function  for ex...abc.aspx/functionname.
 getUrl: function () {
            var sortDir = (this.sortDir == "up") ? "asc" : "desc";
            var sort = ['ShipCountry', 'contactName', 'orderID', 'OrderDate', 'RequiredDate', 'ShippedDate',
                 'ShipVia', 'Freight', 'ShipName', 'ShipAddress', 'ShipCity', 'ShipRegion', 'ShipPostalCode'];
            return { url: "/demos/pagingGetOrders", data: "cur_page=" + this.curPage + "&records_per_page=" +
                this.rPP + "&sortBy=" + sort[this.sortIndx] + "&dir=" + sortDir };
        }

5
i want to call a c# web service method that returns a datatable and display that datatable data in paramquery grid.How can i do this?

Pages: [1]