Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

Threaded View

  1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    22
    Answers
    1
    Vote Rating
    0
    slmckenzie is on a distinguished road

      0  

    Default Answered: OK, so I'm a dummy. Simple MVC Help Please!

    Answered: OK, so I'm a dummy. Simple MVC Help Please!


    Back in ST 1.0, I had a great interface that I developed for my Capstone project. Everything worked wonderfully, and I was good to go. Fast forward to a year later, and I am attempting to make a similar, simple interface for a local non-profit organization. However, ST 2.0 has been released, and a number of significant changes have been made. Unfortunately, those changes have confused me, and I've gotten stuck in a rut that I'm not sure how to solve.

    Basically, so far I have a simple interface, where the user accesses a homepage (tabpanel), with various different pages (tabs) that he or she can navigate too. I'm only working on the first page so far, which has a backend model / store / view, that takes a set of data from a backend database, returns it in JSON form, parses, and displays on the page. So far, so good. And it's been working!

    However, I'm running into a problem where I'm getting the following warning:

    [WARN][Anonymous] [Ext.Loader] Synchronously loading 'Blue.store.Animals'; consider adding 'Blue.store.Animals' explicitly as a require of the corresponding class
    It's interesting to note that I don't get this error all the time. If I'm REALLY lucky, I won't get the warning, and everything will load and run just fine. If I'm only just slightly lucky, I'll get the warning, but everything will still work fine.

    Unfortunately, I may ALSO get the following error in addition to the warning:

    Uncaught Error: [ERROR][Ext.data.Store#setModel] Model with name "Blue.model.Animals" does not exist.
    This error is a showstopper, and causes it to fail, and nothing will happen. But, by simply refreshing the page, I'll get one of the three above responses: 1) It works fine, 2) It warns and still works, 3) It errors and fails.

    Due to the fact that refreshing the same dang page without making any changes to it causes me to get one of three outcomes, makes me think that there's a synchronization issue going on somewhere. But, this is such a simple example, and I'm not doing anything fancy, and yet I STILL can't get it to work!

    Here's my code for my model, store, and view. Could someone take a look at it and point me to where I'm going wrong? I've been battling it most of the day, and I'm sure the solution is simple, to someone who has a better idea of what they're doing. But it's killing me!

    Store:
    Code:
    Ext.define('Blue.store.Animals', {    extend: 'Ext.data.Store',
        id: 'animalstore',
        config: {
              model: 'Blue.model.Animals',
              autoLoad: true,
            proxy: {
                type: 'ajax',
                url: 'php/json/animal_data.php',
                reader: {
                    type: 'json',
                    rootProperty: 'animals'
                }
            }
        },
    });
    Model:
    Code:
    Ext.define('Blue.model.Animals', {    extend: 'Ext.data.Model',
        config: {
            fields: ['Animal_ID', 'Name']
        }
    });
    View:
    Code:
    animalStore = Ext.create('Blue.store.Animals');//animalStore.load();
    
    
    menuList = Ext.create('Ext.List', {
        title: 'Animalsaaaa',
        useToolbar: Ext.is.Phone ? false : true,
        hidden: !Ext.is.Phone && Ext.Viewport.orientation == 'portrait',
        toolbar: Ext.is.Phone ? this.navigationBar : null,
        allowDeselect: false,
        singleSelect: true,
        text: 'Animalsssss',
        itemTpl: '{Name}',
        store: animalStore,
        id: 'animalstorelist',
        //autoLoad: true,
    });
    
    
    Ext.define('Blue.view.Animals', {
        extend: 'Ext.Panel',
        alias: 'widget.animals',
        layout: 'vbox',
        title: "Animals View",
        layout: 'fit',
        config: {
            items: [{
                xtype: 'titlebar',
                docked: 'top',
                title: 'Animal Administration',
                items: [{
                    xtype: 'spacer'
                },{
                    xtype: 'searchfield',
                    placeHolder: 'Search',
                    name: 'searchfield',
                    align: 'right'
                },{
                    xtype: 'button',
                    text: '?',
                    name: 'help',
                    align: 'right'
                }]
            },{
                xtype: 'panel',
                layout: 'fit',
                width: 300,
                docked: 'left',
                items: [
                    menuList,
                {
                    xtype: 'toolbar',
                    docked: 'top',
                    title: 'Animals',
                    items: [{
                        xtype: 'spacer'
                    },{
                        xtype: 'button',
                        name: 'add',
                        align: 'right',
                        iconCls: 'add',
                        ui: 'plain',
                        iconMask: true
                    }]
                }]
            },{
                xtype: 'panel',
                layout: 'card',
                html: '<p>Blah<br><br><Br><Br><br></p>',
                items: [{
                    xtype: 'panel',
                    id: 'animalplaceholder',
                    cls: 'launchscreen',
                    html: '<img src="lib/touch/resources/themes/images/default/pictos/info.png"/><h2><i>Click an animal on the left...</i></h2>',
                    height: '100%',
                    fullscreen: true
                },{
                    xtype: 'panel',
                    html: '<p>Teexty Texty</p>'
                }]
            }]
        },
        initialize: function() {
            console.log('initialize animals view');
            this.callParent();
        }
    });
    Thanks for your help!

  2. Hi slmckenzie,

    hmm, this is strange.
    I quickly created an app-structure, which implements things roughly as you need them. Maybe you can look at this again and compare it to your implementation. Also take care of foldernames etc. (plural s or no plural s).

    This version does work :

    File: app.js
    Code:
    Ext.application({
        name: 'App',
    
        views: ['Menu'],
        
        stores: ['Animals'],
    
        launch: function() {
            Ext.Viewport.add(Ext.create('App.view.Menu'));
        }
    });
    File: app/view/Menu.js
    Code:
    Ext.define('App.view.Menu', {
        extend: 'Ext.Container',
    
        config: {
            layout: 'fit',
            items: [
                {
                    xtype: 'list',
                    store: 'Animals',
                    itemTpl: '<b>{id}</b> {name}'
                }
            ]
        }
    });
    File: app/model/Animal.js
    Code:
    Ext.define('App.model.Animal', {
        extend: 'Ext.data.Model',
    
        config: {
            fields: [
                {
                    name: 'id',
                    type: 'int'
                },
                {
                    name: 'name',
                    type: 'string'
                }
            ]
        }
    });
    File: app/store/Animals.js
    Code:
    Ext.define('App.store.Animals', {
        extend: 'Ext.data.Store',
        
        requires: ['App.model.Animal'],
    
        config: {
            model: 'App.model.Animal',
            
            autoLoad: true,
            proxy: {
                type: 'ajax',
                url: 'animals.php',
                reader: {
                    type: 'json'
                }
            }
        }    
    });
    File: animals.php (to simulate loading data from a server/database)
    Code:
    <?php
    
    echo json_encode(
        array(
            array( 'id' => 1, 'name' => 'Dog' ),
            array( 'id' => 2, 'name' => 'Cat' ),
            array( 'id' => 3, 'name' => 'Cow' )
        )
    );
    
    ?>
    Good luck and best regards
    Schildi