1. #1
    Sencha User
    Join Date
    Dec 2013
    Posts
    6
    Vote Rating
    0
    Selka is on a distinguished road

      0  

    Default Problemas with Views

    Problemas with Views


    hello!
    I have a problem and I can not move forward with my app.
    I'm trying to create an app where I have a major js, that calls a controller and this controller creates an instance of a view.
    The problem is that it seems to create the view (which is a panel) but it creates a vacuum, I put an html and I do not paint, I put items nor paints, I've tried several ways and did not catch me in any ways, put the code to see if anyone sees what I see ... hehe

    MAIN JS:
    Ext.Loader.setPath('geo', '/Geolocalizador/geo');
    Ext.application({
    controllers : ['geo.controller.ListaPreferenciasCtrl'],
    launch : function() {
    var me = this;
    Ext.myapp = this;
    me.createApp();
    },
    createApp: function(){
    var me = this;

    var panel = Ext.create('Ext.Panel');
    panel.add(me.getController('geo.controller.ListaPreferenciasCtrl').createListaPreferenciasView() );
    Ext.Viewport.add(panel);
    }
    });


    CONTROLLER:
    Ext.define('geo.controller.ListaPreferenciasCtrl', {
    extend: 'Ext.app.Controller',
    views: ['ListaPreferenciasView'],
    init: function () {
    this.callParent();
    },
    createListaPreferenciasView: function(){
    var win = Ext.create('geo.view.ListaPreferenciasView',{});
    return win;
    }
    });


    VIEW:
    Ext.define('geo.view.ListaPreferenciasView' ,{
    extend: 'Ext.Panel',
    alias : 'widget.listapreferencias',
    name: 'listapreferenciasview',
    html: "hola mundo 2"
    });


    If the controller instead of creating a instacia my view, I think a panel style of a continent, if it works and paints the html.

    createListaPreferenciasView: function(){
    console.log("CREANDO LISTA DE PREFERENCIAS");
    var win = Ext.create('Ext.Panel', {
    html: 'hola mundo'
    });
    return win;
    }

    please if anyone sees something wrong, tell me so, I'm stuck!


    thanks

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,856
    Vote Rating
    126
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    Please use code tags when you post code.
    You shouldn't call methods in your controller.
    What are you trying to accomplish by creating your view this way?
    You should add a layout to your main panel.
    You should give your 'geo.view.ListaPreferenciasView' some sort of sizing.
    Either height and width or flex.
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  3. #3
    Sencha User
    Join Date
    Dec 2013
    Posts
    6
    Vote Rating
    0
    Selka is on a distinguished road

      0  

    Default


    Thanks for answering, from the tags did not know, I'll put from now.


    I already tried putting height and width, but still not out anything.
    I try to create a panel and put there my items, list, fields etc ...
    the view is a panel that if you create it, the problem is that it creates a vacuum, you put what you put, no business, no html, no label or anything ...

  4. #4
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,856
    Vote Rating
    126
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    Forgive me I do not understand what you mean when you say it creates a vacuum.
    Regardless you need to add some kind of sizing to your 'geo.view.ListaPreferenciasView' definition. And add a layout to the main panel (vbox or hbox). Without it the framework will not know how to size these objects and they will not display.


    Let's take the controller out of the equation. If you change your main.js to the following. Does it display as desired.
    Code:
    panel.add(Ext.create('geo.view.ListaPreferenciasView'));
    Ext.Viewport.add(panel);

    Coding note your app name should start with a capital letter (ie. Geo)
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  5. #5
    Sencha User
    Join Date
    Dec 2013
    Posts
    6
    Vote Rating
    0
    Selka is on a distinguished road

      0  

    Default


    does not work, I've also tried the following code and also ...
    I tried putting size, position, etc, and does not work.

    Code:
       var panel = Ext.create('Ext.Panel', {
                items: [
                    {
                        xtype: 'listapreferencias'
                    }                
                ]
            });
            Ext.Viewport.add(panel);

  6. #6
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,856
    Vote Rating
    126
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    Since you are using define your view configs should be defined within a config object
    Code:
    Ext.define('geo.view.ListaPreferenciasView', {
        extend: 'Ext.Panel',
        alias: 'widget.listapreferencias',
        config: {
            name: 'listapreferenciasview',
            html: "hola mundo 2",
        }
    });
    Here is a working fiddle:
    https://fiddle.sencha.com/#fiddle/2er

    You should also check your browser's console for errors.
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi