1

How can I use the client object model in javascript to have a function to refresh a list view?

Scenario: I have a form that uses a button which uses the sharepoint client object model to insert a list item, but after its finished it does not refresh on its own, no I dont want it to refresh automatically every 15 seconds, I want it to refresh the moment the item gets inserted like in the out of the box forms, how can I achieve this?

2

You can use a Item Adding event that will do a partial post back as you said your using "Forms" or you can use AJAX update panel

Check this link out as well, its for webparts but I guess your using ListView Webpart so might help, plus which forms are you using ?

how-to-automatically-refresh-sharepoint

0

Hi from what I guess is you want to refresh a list view when an item has been added via client side using a javascript function?

you can do that using this: there is a method called "Enable Asynchronous Update" what would do the trick ;), this is out of the box function that already exists.

http://weblogs.asp.net/jan/archive/2010/03/01/little-sharepoint-2010-gem-ajax-options-in-list-view-web-parts.aspx

also using SPGridView you can build your list, bind the data from the database and then wack it in an updatepanel!

It is much faster, safer, easier and above all adhears to the sharepoint client object model

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.