docs/release/framework/vcomet/data/store/StoreRest.js
function restXhr(store, url, eventName, sortRequest) {
      // Set up request
      var xhr = new XMLHttpRequest();
      xhr.open("GET", url, true);
      // TODO - Set range header parameter
      xhr.setRequestHeader("Content-Type", "application/json");
      // Callback
      xhr.onload = function(e) {
        // If operation has been completed - ready state 4
        if (xhr.readyState === 4) {
          // Response status successfully completed - status 200
          if (xhr.status === 200) {
            // Set up store
            store._setUpData(xhr.response);
            // Process store data filters and lists
            vcomet.StoreMemory.processData(store);
            // Set data as sorted
            store.data.__sorted = sortRequest;
            // Update store data items length
            store.size = xhr.getResponseHeader("Total");
            // Trigger user callback once data has been retrieved
            vcomet.triggerCallback(eventName, store, store, [store.rootData]);
            vcomet.createCallback("onSourceChanged", store, store, [store.rootData]);
          }
        }
      };
      // Execute request
      store.onLoaded(function(){xhr.send()});
    }
function restXhr(store, url, eventName, sortRequest) {
      // Set up request
      var xhr = new XMLHttpRequest();
      xhr.open("GET", url, true);
      // TODO - Set range header parameter
      xhr.setRequestHeader("Content-Type", "application/json");
      // Callback
      xhr.onload = function(e) {
        // If operation has been completed - ready state 4
        if (xhr.readyState === 4) {
          // Response status successfully completed - status 200
          if (xhr.status === 200) {
            // Set up store
            store._setUpData(xhr.response);
            // Process store data filters and lists
            vcomet.StoreMemory.processData(store);
            // Set data as sorted
            store.data.__sorted = sortRequest;
            // Update store data items length
            store.size = xhr.getResponseHeader("Total");
            // Trigger user callback once data has been retrieved
            vcomet.triggerCallback(eventName, store, store, [store.rootData]);
            vcomet.createCallback("onSourceChanged", store, store, [store.rootData]);
          }
        }
      };
      // Execute request
      store.onLoaded(function(){xhr.send()});
    }
function restXhr ( store , url , eventName , sortRequest ) { // Set up request var xhr = new XMLHttpRequest ( ) ; xhr . open ( "GET" , url , true ) ; // TODO - Set range header parameter xhr . setRequestHeader ( "Content-Type" , "application/json" ) ; // Callback xhr . onload = function ( e ) { // If operation has been completed - ready state 4 if ( xhr . readyState === 4 ) { // Response status successfully completed - status 200 if ( xhr . status === 200 ) { // Set up store store . _setUpData ( xhr . response ) ; // Process store data filters and lists vcomet . StoreMemory . processData ( store ) ; // Set data as sorted store . data . __sorted = sortRequest ; // Update store data items length store . size = xhr . getResponseHeader ( "Total" ) ; // Trigger user callback once data has been retrieved vcomet . triggerCallback ( eventName , store , store , [ store . rootData ] ) ; vcomet . createCallback ( "onSourceChanged" , store , store , [ store . rootData ] ) ; } } } ; // Execute request store . onLoaded ( function ( ) { xhr . send ( ) } ) ; }
Set up and execute xhr request
@param  {[type]} el      [description]
@param  {[type]} url     [description]
@param  {[type]} event   [description]
@return {[type]}         [description]
 /*
@function restXhr
@description Set up and execute xhr request
@param {Object} store [Store element]
@param {String} url [Request url]
@param {String} eventName [Callback event name]
@param {Boolean} sortRequest [Whether or not data has been sorted]
Set up and execute xhr request