It seems quite simple to use HTTP POST method in igGrid using ajax post call by specifying requestType attribute. But, I am not able to find any method to specify the requestType in ASP.NET MVC wrapper for igGrid ( Infragistics 16.2 ).
@(Html.Infragistics()
.Grid(Model)
.ID("transactionGrid")
.PrimaryKey("ID")
.Height("550px")
.Width("100%")
.AutoGenerateColumns(false)
.AutoGenerateLayouts(false)
.Columns(column =>
{
column.For(x => x.ID).HeaderText("Broker");
column.For(x => x.Category).HeaderText("Category");
//column.For(x => x.BrokerName).HeaderText("Broker");
column.For(x => x.ParAmount).HeaderText("Par").Format("N2");
column.For(x => x.CommissionAmount).HeaderText("Commission").Format("N2");
})
.Features(features =>
{
features.Sorting().Type(OpType.Local);
features.Filtering().Type(OpType.Local);
features.Summaries()
.Type(OpType.Local).CalculateRenderMode(SummaryCalculateRenderMode.OnSelect)
.ColumnSettings(cs =>
{
cs.ColumnSetting().ColumnKey("CommissionAmount").SummaryOperands(so =>
{
so.SummaryOperand().Type(SummaryFunction.Sum).Active(true);
});
cs.ColumnSetting().ColumnKey("ParAmount").SummaryOperands(so =>
{
so.SummaryOperand().Type(SummaryFunction.Sum).Active(true);
});
cs.ColumnSetting().ColumnKey("Category").AllowSummaries(false);
cs.ColumnSetting().ColumnKey("ID").AllowSummaries(false);
});
})
.DataSourceUrl(Url.Action("GetTransactions"))
.DataBind()
.Render()
)
You can still set it through the grid prototype with:
$.ui.igGrid.prototype.requestType = "POST"
added somewhere before the grid initialization code.
The reason it is not exposed is that the automated remote operations such as Sorting/Filtering/Paging etc. only work with parameters encoded in the URL which assumes a GET request. If you handle the remote operations yourself, that is you are not decorating your controller methods with GridDataSourceActionAttribute, there is no reason you can't change the request type through the aforementioned prototype change and read and process the query from the request body.
Hope this helps!