jQWidgets Forums

jQuery UI Widgets Forums Grid Pass an argument to URL method

This topic contains 4 replies, has 2 voices, and was last updated by  ms.orihuela 11 years, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Pass an argument to URL method #24441

    ms.orihuela
    Participant

    I want to know how pass the arguments to a method.

    var source =
    {
    datatype: “xml”,
    datafields: dataFields,
    url: ‘Country.aspx/GetCountry’,
    record: ‘Table’
    }

    [WebMethod]
    [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Xml)]
    public static string GetCountry(int index)
    {
    DataSet data = new CountryBL().getCountry(index);
    StringWriter writer = new StringWriter();
    data.Tables[0].WriteXml(writer, XmlWriteMode.WriteSchema, false);
    return writer.ToString();
    }

    Pass an argument to URL method #24457

    Dimitar
    Participant

    Hello ms.orihuela,

    Please check out the documentation entry on Adding extra HTTP variables. We hope it is helpful to you.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Pass an argument to URL method #24521

    ms.orihuela
    Participant

    I read the documentation and change my code according to the information.

    var source =
    {
    datatype: “xml”,
    datafields: dataFields,
    url: ‘Country.aspx/GetCountry’,
    record: ‘Table’
    }

    var SearchDataAdapter = new $.jqx.dataAdapter(source, {
    contentType: ‘application/json; charset=utf-8’,
    formatData: function(data) {
    return “{‘index’:’5′}”;
    }
    });

    I dont know if I do something wrong because it doesn’t work.

    Thanks for your help

    Pass an argument to URL method #24535

    Dimitar
    Participant

    Hi ms.orihuela,

    Please note the way that dataAdapter is defined in the example:

    var dataAdapter = new $.jqx.dataAdapter(source,
    {
    formatData: function (data) {
    $.extend(data, {
    featureClass: "P",
    style: "full",
    maxRows: 50
    });
    return data;
    }
    }
    );

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Pass an argument to URL method #24610

    ms.orihuela
    Participant

    Thanks for your help! It works, but only when pass numbers. When pass a letter o a word, no call to page method.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.