Thursday 12 June 2014

Sharepoint hosted app list view filter option is missing

Problem: While developing SharePoint hosted app, i am not able to find any interface to add filter for any view.
Solution:
After creating some views. Save the app.
Open Schema.xml
You will find all Views.
You can find one tag <Query/>
Remove above tag and add below code.
<Query>
<Where>
<Eq>
<FieldRef Name="State"></FieldRef>
<Value Type="Choice">UK</Value>
</Eq>
</Where>
<OrderBy>
<FieldRef Name="Title"></FieldRef>
<FieldRef Name="State"></FieldRef>
</OrderBy>
</Query>
Save
Deploy the app.
Now you will see your view with filtered data.