1. #1
    Sencha User
    Join Date
    Aug 2011
    Location
    Brescia - Italy
    Posts
    102
    Vote Rating
    4
    tino7_03 is on a distinguished road

      0  

    Default Ext.ux.touch.grid.View in MVC app

    Ext.ux.touch.grid.View in MVC app


    I have this problem when I use Ext.ux.touch.grid.View in MVC app.
    I have a view like this:

    PHP Code:
    Ext.define('GpMobile.view.Customers', {
        
    extend'Ext.Panel',
        
    alias 'widget.customers',
        
    config:{
             
    fullscreen:true,
             
    items:[
                        {                        
    xtype:'touchgridpanel',
                                                 
    store      null,
                                                 
    features   : [
                                                                      {                                
    ftype    'Ext.ux.touch.grid.feature.Paging',
                                                                                                        
    launchFn 'initialize'                            
                                                                      
    },
                                                                      {                                
    ftype    'Ext.ux.touch.grid.feature.Sorter',
                                                                                                        
    launchFn 'initialize'
                                                                      
    }
                                                                 ],
                                                
    columns   : [
                                                                     {                                
    header    'Ragione sociale'
                                                                                                      
    dataIndex 'an_descr1',  
                                                                                                      
    width     '100%'
                                                                      
    }
                                                 ] 
                                     }             
                      ] 
        }    
    }); 
    If I write in the views.js file an alert like this:

    PHP Code:
    initialize: function() {        
                var 
    me this;        
                
    alert(me._columns);
                
    me.header me.buildHeader();
                if (
    typeof me.initFeatures === 'function' && typeof me.features === 'object') {
                            
    me.initFeatures(me.features'initialize');        
                }
                
    me.callParent(arguments);
                
    me.header.setHtml(me._buildTpl(me.getColumns(), true));
     }, 
    the execution returns an empty message, but if I use the same alert when I use a not MVC app the alert returns an object (the grid columns).
    This scenario creates problems if I want get columns from a custom feature and I don't understant how I can to solve.
    Thanks in advance for the help, it's very important issue for me.

    P.S.: In my example the store is null, because it has not effects about this problem.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,404
    Vote Rating
    849
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    I tried this and it worked with no problems:

    Code:
    Ext.define('GpMobile.view.Customers', {
        extend: 'Ext.Panel',
        alias : 'widget.customers',
        config:{
            fullscreen:true,
            layout : 'fit',
            items:[
                {
                    xtype:'touchgridpanel',
                    store      : null,
                    features   : [
                        {
                            ftype    : 'Ext.ux.touch.grid.feature.Paging',
                            launchFn : 'initialize'
                        },
                        {
                            ftype    : 'Ext.ux.touch.grid.feature.Sorter',
                            launchFn : 'initialize'
                        }
                    ],
                    columns   : [
                        {
                            header    : 'Ragione sociale',
                            dataIndex : 'an_descr1',
                            width     : '100%'
                        }
                    ]
                }
            ]
        }
    });
    All I did was clean your code up (spacing) and add layout : 'fit'. The column header showed just fine.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

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

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

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

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Location
    Brescia - Italy
    Posts
    102
    Vote Rating
    4
    tino7_03 is on a distinguished road

      0  

    Default


    Thanks very mutch for your reply. It's very important for me to solve this problem because it is stopping my project.
    In my case aslo there are not problem with column header. I can see it, but the "me._columns" is empty in "initialize" function of views.js. If I use the grid in a no MVC project the "me.columns" is full with columns data.
    The problem is not the screen output but I'd need the "me.columns" not empty for to build my plugin, because in "init" function of my plugin the "grid.getColumns" returns an empty result (only in mvc project).
    Why are there two different situations if the app is or not is an MVC project?

    I need help very mutch....
    Thanks again.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,404
    Vote Rating
    849
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    try the getter...

    Code:
    me.getColumns()
    Stuff in the config object, you shouldn't reference by the property but by the getter.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

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

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

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

  5. #5
    Sencha User
    Join Date
    Aug 2011
    Location
    Brescia - Italy
    Posts
    102
    Vote Rating
    4
    tino7_03 is on a distinguished road

      0  

    Default


    I've tryed the first time, but with empty result. So, after I have used "me._column" but with the same result. I've tryed again now, but empty result always...


    and the "grid.getColumns" in the "init" function of my plugin is in the same situation. My plugin works if not used in MVC app because grid.getColumns returns all columns.

Thread Participants: 1