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 12 years, 9 months ago.
-
Author
-
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();
}Hello ms.orihuela,
Please check out the documentation entry on Adding extra HTTP variables. We hope it is helpful to you.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/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
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,
DimitarjQWidgets team
http://www.jqwidgets.com/Thanks for your help! It works, but only when pass numbers. When pass a letter o a word, no call to page method.
-
AuthorPosts
You must be logged in to reply to this topic.