Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > JavaScript API > Examples

How to refresh the List page after editing in a popup

Scroll Prev Next More

 

By default, ASPRunner.NET updates the List page automatically with new data. However, if you perform some actions behind the scene like adding a new record in the AfterEdit event, you might need to refresh the List page manually.

 

To refresh the List page manually, add the following code to the List page: JavaScript OnLoad event:

 

this.on('afterInlineEdit', function( fieldsData ) {
location.reload();
});

 

To refresh the grid on the List page without reloading the page, use the following code in the JavaScript OnLoad event:

 

Note: the AJAX search, pagination and sorting option should be enabled (Choose pages -> List page settings).

 

Runner.runnerAJAX(Runner.pages.getUrl(pageObj.tName, pageObj.pageType)+"?a=return",
    pageObj.ajaxBaseParams,
  function(respObj){
     pageObj.pageReloadHn.call(pageObj, respObj)
    });

 

If you need to use both snippets at the same time, add the following code to the List page JavaScript OnLoad event:

 

Note: the AJAX search, pagination and sorting option should be enabled (Choose pages -> List page settings).

 

window.listPage = pageObj;

 

And add the following code to the Edit page JavaScript OnLoad:

 

this.on('afterSave', function() {
var pageObj = window.listPage;
Runner.runnerAJAX(Runner.pages.getUrl(pageObj.tName, pageObj.pageType)+"?a=return",
pageObj.ajaxBaseParams,
function(respObj){
pageObj.pageReloadHn.call(pageObj, respObj)
});
});

See also:

JavaScript API: Control object > on()

JavaScript API: Control object

JavaScript API: RunnerPage object

Events: JavaScript OnLoad

AJAX-based Functionality

Choose pages screen

List page settings

JavaScript API