URL parsing in .net core api

79 views Asked by At

For a grid I have used jqwidget on client side. While filtering the data from grid the jqwidget create a url like

https://localhost:44330/api/role/index?FilterGroups[0][field]=roleName&FilterGroups[1][field]=createdDate

In a .NET core site I have made a model like this to fetch that data enter image description here

And a controller like this

    [HttpGet("index")]
    public async Task<ResponseData<IndexData>> GetIndexData([FromQuery] PaginationQuery model)
    {
        return await _logic.GetIndexDataAsync(model);
    }

But I am unable to get those flter value

How can I achieve that??

1

There are 1 answers

0
Saravanan On

Could you try to get hold of the filter event and get the filters, set as post json data and then invoke the api call like

$("#jqxGrid").on("filter", function (event) 
{
    var filterinfo = $("#jqxgrid").jqxGrid('getfilterinformation');
    // convert filterinfo to your required model or use as it is 
    // post to the API and get response back.
});