Search code examples
odataurifilteringignite-uiiggrid

IgGrid: How to get the odata queryString of remote filtering in JavaScript


I use infragistics grid (v16.1) with remote filtering. When I filter column "Name" I see that the grid makes GET request in the following manner:

http://SERVER/grid/GetAll?&%24filter=indexof(tolower(name)%2C%27iv%27)+ge+0&page=0&pageSize=30&pk=id&_=1473841534609&pageSize=30&pk=id&_=1473841534609

The part between "filter=" and "&page" indexof(tolower(name)%2C%27iv%27)+ge+0 is query option of OData Uri components that I am interested in.

I need to use this request URI or only the query option in JavaScript.


Solution

  • You can get the url parameters using the _encodeUrl() method of the grid’s data source, for example:

    var encodedUrl = $("#grid").data("igGrid").dataSource._encodeUrl()
    

    This will return an object with all of the current url parameters that would be send if a remote request is initiated.