I have a custom list and I have to render filtered data dynamically.

The scenario is, I have some SPGroups i.e. (Requester and Approver). If the current user is in Requester group then I have to show only records that are created by him only and if current user is in Approver group then I have to apply some other filter.

I have tried solution provided by Vadim Gremyachev on Stack exchange, this is working fine if we provide array of IDs static. If I am trying to get filtered data using caml query, as soon as I apply executeQyeryAsync to get list data, page loads and rendering onPreRender does not work.

Is there any way, I can achieve this functionality.


There is way to achieve this by using Manipulating the url with current url. i.e: before page load you get the user belongs to which category the add addtional url attach to that existing url like url_full_url/AllItems.aspxFilterField1=Filter_Column_Name&FilterValue1=Login_User_name (This can achieve using master page modification on navigation part else you need to load the page two times i.e: first u need to load the then again get the url then add your adition url then agagin redirect). This user name also you can get through SP Services else JSOM then your work will be over. :-)

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.