How to refresh List View in SharePoint 2013 using JavaScript

One of the short tip to refresh the list view using JavaScript code is as below:

// Set Ajax refresh context
var evtAjax = {
  currentCtx: ctx,
  csrAjaxRefresh: true
};
// Initiate Ajax Refresh on the list
AJAXRefreshView(evtAjax, SP.UI.DialogResult.OK);

You can place this code after completing your operation on list item or on success method. Where ctx is the current site context.

var ctx = SP.ClientContext.get_current();

This code usually helps in Client Side Rendering (CSR) / JSLink.

Keep SharePointing!

Advertisements

One thought on “How to refresh List View in SharePoint 2013 using JavaScript

  1. Pingback: Refresh web part without refreshing page in SharePoint - Binary Bits

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s