Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Incorrect Guide : MVC Application Architecture

  1. #11
    Sencha User
    Join Date
    Feb 2008
    Location
    @bryanzarzuela
    Posts
    55

    Default

    Use a local web server and not a file:// based protocol.

    Quote Originally Posted by Berzzzebub View Post
    I have problems even with this example.
    XMLHttpRequest cannot load file:///C:/path/to/ext/folder/examples/app/simple/data/users.json?_dc=1306734398912&page=1&start=0&limit=25. Origin null is not allowed by Access-Control-Allow-Origin.

  2. #12

    Default

    Thanks.

  3. #13
    Sencha Premium Member
    Join Date
    Jul 2011
    Posts
    29

    Default

    Well great advice except that the ext-4.0.2a\examples\app\simple is bust too. I get:
    Uncaught Ext.Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: Ext.container.Viewport

    To fix I had to edit ext-4.0.2a\examples\app\simple\simple.html and add the loader config below immediately after:
    <script type="text/javascript" src="../../../builds/ext-core.js"></script>

    <script type="text/javascript">
    Ext.Loader.setConfig({
    enabled: true,
    disableCaching: true,
    paths: { 'Ext': '../../../src' }
    });
    </script>

  4. #14
    Sencha User
    Join Date
    Aug 2009
    Location
    Tamworth, NSW, Australia
    Posts
    32

    Default

    Thanks for the solution. I was tearing my hair out trying to figure out why I couldn't get a simple demo working. By the looks of it, ExtJS 4's new MVC doesn't really look to be ready for prime time, so I might stick with modifying the user-editable output from Ext Designer for the time being.

  5. #15
    Sencha User
    Join Date
    Jan 2012
    Posts
    2

    Default Problem accessing store in combo

    Hi,

    I am new to ExtJS, currently using extJs4. I was able to build the MVC sample as provided in below link.
    http://docs.sencha.com/ext-js/4-0/#!...n_architecture

    This is working fine if I use as is, accessing store in this below grid Panel.

    Code:
    Ext.define('AM.view.user.List' ,{
        extend: 'Ext.grid.Panel',
        alias : 'widget.userlist',
    
        title : 'All Users',
        store: 'Users',
        initComponent: function() {
            this.columns = [
                {header: 'Name',  dataIndex: 'name',  flex: 1},
                {header: 'Email', dataIndex: 'email', flex: 1}
            ];
    
            this.callParent(arguments);
        }
    });
    But when I try to access this store in combo in a Panel, it throws error as

    me.store is undefined
    http://localhost:9081/extjs_samples_...S/ext-debug.js
    Line 8447


    Here below is my code:

    Code:
    Ext.define('AM.view.user.List' ,{
        extend: 'Ext.panel.Panel',
        alias : 'widget.userlist',
        requires: ['AM.store.Users'],
        items:[
                   {
                       xtype: 'panel',
                       html: 'This is userlist'
                   },
                   Ext.create('Ext.form.field.ComboBox', {
                       store: 'Users',
                       allowBlank:false,
                       required:true,
                       editable:false,
                       displayField:'name',
                       queryMode: 'local',
                       triggerAction: 'all',
                       lastQuery: ''
                   })
               ]
    });
    I tried using fully qualified name as store: 'AM.store.Users', but no use.

    I must be missing something, I appreciate your help.

    apart from API, where can I find good tutorials of Ext Js4.

    Thank in advance.

  6. #16
    Sencha User
    Join Date
    Jan 2012
    Posts
    2

    Default

    I was able to figure out that instead of using "Ext.create('Ext.form.field.ComboBox', {".
    I create combo as below, then I was able to resolve this issue, well I still need to understand, why so.
    I will try to find out.
    {
    xtype: 'combobox',
    fieldLabel: 'Users',
    id: 'UsersId',
    name: 'Users',
    store: 'Users',
    queryMode: 'local',
    displayField: 'name',
    valueField: 'name',
    typeAhead: true,
    emptyText: 'Select a User...'
    }

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Guide to a simple MVC application
    By matteoli in forum Ext: Discussion
    Replies: 2
    Last Post: 23 Apr 2011, 6:58 AM
  2. Application Architecture
    By Jehu in forum Ext: Discussion
    Replies: 5
    Last Post: 25 Feb 2011, 8:13 AM
  3. Need help with application architecture
    By xanf in forum Community Discussion
    Replies: 3
    Last Post: 17 Aug 2010, 4:40 AM
  4. Application Architecture
    By Dave.Sanders in forum Community Discussion
    Replies: 4
    Last Post: 19 Jun 2009, 9:08 AM
  5. Application architecture.
    By santail in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 19 May 2009, 6:21 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •