Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Changing the url for a datasource fetch operation

    Hello,

    I have a function that automatically refresh all grids on my application. Basically, it loops on grids and call invalidateCache().

    The issue, is that when i do this "auto refresh call", i need to pass an additional parameter so that this request does not update the user session.

    If i have a url like: /example/fetch

    I would like to use: /example/fetch/autoRefresh/true

    Nice, so i came up with this code:

    Code:
    if (autoRefresh) {
        listGrid.dataSource.operationBindings[0].dataURL = window[i].dataSource.operationBindings[0].dataURL +'/autoRefresh/true';
    }
    			
    listGrid.invalidateCache();
    			
    // Remove auto refresh from url
    if (autoRefresh) {
        listGrid.dataSource.operationBindings[0].dataURL = window[i].dataSource.operationBindings[0].dataURL.replace('\/autoRefresh\/true', '');
    }
    But it seems that invalidateCache request is done after the autoRefresh was already removed from the URL. Is there a way to solve this?

    This parameter could also be a POST variable, it doesn't matter, as long as i can add and remove it from the request.

    Thanks!
Working...
X