What I want to do: I have a custom list that contains a lot of items. When an user loads the list, all items of his view should be checked. If there is a special value in the listitem a notifiaction should be added.

What I've tried: I didn't find a way to trigger the onload event. I've searched in the custom ListEventReceiver and in the Javascript ClientModel.

Does any one have an idea how to solve this?

  • Do you need to select ALL items in the whole list? Or only on the current page? – Ruben Herman Aug 2 '12 at 9:36
  • @RubenHerman only the Items of the current page! – MOI Aug 2 '12 at 10:18
  • Ok, than you can still use the anwser I described below. To check all items faster, you can also include jQuery – Ruben Herman Aug 2 '12 at 10:35

You'll need a combination of js and the sharepoint client object model (client object model is to check te value of a listitem).

Use this function to start your code after the sharepoint js is loaded:

 ExecuteOrDelayUntilScriptLoaded(myInitMethod, "sp.js");
| improve this answer | |
  • where do I implement this code? – MOI Aug 2 '12 at 10:19
  • you have some possibilities... you can add it in a js file, add a scriptblock to your (master)page, add a content editor webpart and edit the html – Ruben Herman Aug 2 '12 at 10:21
  • here are some examples: techtrainingnotes.blogspot.be/2012/05/… – Ruben Herman Aug 2 '12 at 10:22

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.