1. #1
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    2
    Vote Rating
    0
    marksdean is on a distinguished road

      0  

    Default Unanswered: Running an EXT JS 4.x Application (MVC) without a web server

    Unanswered: Running an EXT JS 4.x Application (MVC) without a web server


    Scenario

    I need to deploy an offline application to a group of users (I will periodically update their data which will most likely be JSON files deployed to their EXT JS application folder).

    I do not want the users to need to run a web server on their machines (PC/Mac laptops).

    The store is loaded using a relative URL:
    Ext.define('Ext4Example.store.Stocks', {
    extend:'Ext.data.Store',
    model:'Ext4Example.model.Stock',
    autoLoad:true,
    listeners:{
    load:function (store, records, successful, eOpts ) {
    console.log('Stocks load: ' + successful);
    }
    },
    proxy:{
    type:'ajax',


    url:'app/store/data.json',


    reader:{
    type:'json',
    listeners:{
    exception:function (reader, response, error, eOpts) {
    console.log('proxy reader: ' + error);
    }
    }
    }
    }
    });

    Is it possible to run the EXT JS 4.x application without a web server?

    I took a simple existing MVC demo application from Loaine Groner (thanks) which populates a grid from inline data, and modified it to read from the local file system.

    If I run the application from a file URI:

    file://localhost/Library/WebServer/Documents/loiane-extjs4-mvc-basic-array-grid-8676e2b/index.html

    the store throws a load exception. However I can see that the data is being response contains the JSON data.


    If I run the application from an http URI the grid populates without error.

    http
    ://localhost/loiane-extjs4-mvc-basic-array-grid-8676e2b/index.html

    Are there any strategies that will allow this? Are there any EXT JS extensions that provide for this? Is node.js a possible solution?

    Any thoughts are appreciated.

    I have attached the modified sample code (you'll need to add the extjs folder to the root directory of the app).

    Thanks,
    Mark

    Attached Files

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,005
    Answers
    666
    Vote Rating
    457
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

Thread Participants: 1

Tags for this Thread