jQWidgets Forums

jQuery UI Widgets Forums Grid Send data to server using Data Adapter

This topic contains 0 replies, has 1 voice, and was last updated by  DeeCan 12 years, 2 months ago.

Viewing 1 post (of 1 total)
  • Author

  • DeeCan
    Member

    Hi all,

    I have a CRUD application built using jqxgrid that is functional. I want to modify my code such that I can send a parameter from the aspx page to server using the source object. I tried changing request type to POST, but it does not reach the webmethod in the asmx file. Can you please help me with this ?

    Thanks
    DeeCan

    ASPX code:

               var db = {
    param: "abc"
    };
    var PostObj = { 'db': db };
    var source = {
    datatype: "json",
    datafields: [
    { name: 'JOBID' },
    { name: 'PRIORITY' },
    { name: 'LOT' },
    { name: 'PART' },
    ],
    type: 'POST',
    url: 'Service.asmx/GetLH',,
    data: JSON.stringify(PostObj),
    updaterow: function (rowid, rowdata){} ,
    deleterow: function (rowid, commit) {}
    }
    var dataAdapter = new $.jqx.dataAdapter(source, {
    contentType: 'application/json; charset=utf-8',
    loadError: function (xhr, status, error) {
    alert(error);
    },
    downloadComplete: function (data) {
    var returnData = {};
    returnData.records = data.d;
    return returnData;
    }
    });

    The code behind in Webservice :

            [WebMethod]
    [ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json)]
    public object GetLH(DieBlock db)
    {
    string part = db.param;
    OracleConnection myOracleConn = OpenDB();
    DataTableReader myDBReader;
    string json;
    myDBReader = ReadLHDB(myOracleConn);
    using (myDBReader)
    {
    json = this.ReadToJsonLH(myDBReader);
    }
    return new JavaScriptSerializer().DeserializeObject(json);
    }
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.