I have a script to pull a custom list using caml query, push it to html and format it with css to appear as a blog preview on our sharepoint homepage. When adding items to the list, users have the ability to select a 'Department' from a drop-down. I currently show all items with a row limit of 3.

I would like to add buttons above the view on my page where users can filter it by the department column without reloading the page. Is it possible using javascript to load new items and filter the default caml query view by the department field?

 ncamlQuery.set_viewXml('<View><Query><Where><Geq><FieldRef Name="Expires"/>' +
'<Value Type="DateTime"><Today/></Value></Geq></Where>' +
'<OrderBy><FieldRef Name="PublishedDate" Ascending="False"></FieldRef>' +

Your Answer

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

Browse other questions tagged or ask your own question.