3

I am trying to pass a URL into a SharePoint listview with parameters for filtering. The FilterOp paramter doesn't work with inplview for me.

If I pass the parameters in normal query string format (?key1=value1&key2=value2), the FilterOp parameter is honored. For example, if I do this:

AllItems.aspx?FilterField1=Date1&FilterValue1=2015-12-31&FilterOp1=Gt

The FilterOp (Gt - greater than) is honored and I only get rows where Date1 is greater than 12/31/2015. However, if the user clicks the paging button to advance to the next page (or modifies a filter or sorts), the syntax switches to the format used by inplview (key1%3Dvalue1-key2%3Dvalue2). But in this format, FilterOp is not honored. For example, if I do this:

AllItems.aspx#inplview[yadayadayada]=FilterField1%3DDate1-FilterValue1%3D2015%252D12%252D31-FilterOp1%3DGt

The FilterOp is ignored. FYI, the hyphens in the date get double encoded to %252D since a hyphen is a parameter separator in this syntax.

Other values for FilterOp are ignored as well. The date encoding complication is not relevant. You can reproduce this filtering issue on a single line of text column.

I need to be able to pass a URL with parameters that filter using FilterOp that will work with inplview to properly support paging, sorting, and filter modification. What am I doing wrong?

Thank you.

0

As far as I can see from my tests, filterop does not work with inplview hash queries, and this is probably by design.

Inplview hash queries (those with a "#") are used to filter, sort and page list view web parts and the rendering is by partial postback. It is really different from classical query string urls (those with a "?"), where they render with a full postback.

I think you shouldn't expect to have in inplview the same parameters you have in standard query strings.

I need to be able to pass a URL with parameters that filter using FilterOp that will work with inplview to properly support paging, sorting, and filter modification

I think the only way you have to do that is via javascript, where you could replace the hash query with a corresponding query string. You should be able to achieve this by hacking the HandleFilterReal function of inplview.js. However you are going to dramatically deteriorate the user experience replacing partial postbacks of inplview ("#") with full postback of query strings ("?").

| improve this answer | |
0

I guess the solution would be to switch your list view web part to use Server Rendering and perhaps disable the Minimal Download Strategy feature if it isn't critical. However that will remove the in-place search box which many users like and increase the number of full page postbacks.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.