1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    18
    Answers
    1
    Vote Rating
    0
    heppi75 is on a distinguished road

      0  

    Default Answered: getDetailCard

    Answered: getDetailCard


    for a couple of days I try to get the listed view up and running. I solved the problem that leafitemtap was not fired - now I have a final problem to get the data into the detailCard - hope someone could help me to finalise my first app ...

    Code:
    // controller
    control: {
                accolist: {
                    leafitemtap: 'getDetailCard'
                }
            }
        },
    
        getDetailCard: function(record) {
            console.log(record);
            data: record.data
        }
    
    //view - detailcard
    detailCard: {
                xtype: 'tabpanel',
                items: [
                    {
                        title: 'Home',
                        scrollable: true,
                        styleHtmlContent: true,
                        tpl: 'Test {name}'
                    },
    no data in the view - please help ...

  2. Look at what the leafitemtap arguments are again. You don't need to worry about the index, the record is the fifth argument.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Answers
    3542
    Vote Rating
    846
    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


    This looks like some copy/pasted code and not all of it is there. Are you setting the data on the tab panel or it's items?
    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.

  4. #3
    Sencha User
    Join Date
    Jan 2011
    Posts
    134
    Answers
    6
    Vote Rating
    5
    JRS is on a distinguished road

      0  

    Default Getting data into items of tabpanel

    Getting data into items of tabpanel


    Hi

    I've also been struggling with issue. In my case I have list (presidentslist demo) with detail card a tabpanel with 3 items (panels). Not sure how to get the data into the item panels.

    Any help or suggestions - would be much appreciated

    Thanks in advance

  5. #4
    Sencha User
    Join Date
    Jan 2011
    Posts
    134
    Answers
    6
    Vote Rating
    5
    JRS is on a distinguished road

      0  

    Default Another thread may have answer to this

    Another thread may have answer to this


    Hello,

    I believe this thread will help answer this question

    Thanks


    http://www.sencha.com/forum/showthre...442#post769442

  6. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    18
    Answers
    1
    Vote Rating
    0
    heppi75 is on a distinguished road

      0  

    Default


    sorry - also the last post did not solve my problem - maybe there is another thing to use in nested lists?

    here ist my code I use for now:

    Code:
    Ext.define('MyApp.view.Accommodations', {
        extend: 'Ext.NestedList',
        xtype: 'accommodationsPanel',
        
        requires: [
            'Ext.TitleBar',
            'Ext.NestedList'
        ],
        
        config: {
            title: 'Accos',
            iconCls: 'star',
            
            fullscreen: true,
            displayField: 'name',
            store: 'Accommodations',
            
            detailCard: {
                xtype: 'tabpanel',
                applyItems: function(items, collection) {    
                    var i = 0,
                    iNum = items.length,
                    data = this.getData();
                    for (; i < iNum; i++) {
                        items[i].data = data;
                    }
                    return this.callParent([items, collection]);
                },
                
                items: [
                    {
                        title: 'Home',
                        scrollable: true,
                        styleHtmlContent: true,
                        tpl: 'Test {name}'
                    },
                    {
                        title: 'Tab 2',
                        scrollable: true,
                        
                    },
                    {
                        title: 'Tab 3',
                        scrollable: true,
                        
                    }
                ]
            }
        }
    });
    
    Ext.define('MyApp.controller.Application', {
        extend: 'Ext.app.Controller',
        
        config: {
            refs: {
                accolist: 'accommodationsPanel'
            },
            control: {
                accolist: {
                    leafitemtap: 'showDetail'
                }
            }
        },
    
        showDetail: function(list, index, element, record) {
            this.getAccolist().getDetailCard({
                data: record.data
            });
            console.log(this);
        }
    });
    I also purchased the premium features - how can I access the premium forum?

  7. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Answers
    3542
    Vote Rating
    846
    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


    You should not use applyItems in a config. You should only use it when creating it's own class with Ext.define
    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.

  8. #7
    Sencha User
    Join Date
    Mar 2012
    Posts
    18
    Answers
    1
    Vote Rating
    0
    heppi75 is on a distinguished road

      0  

    Default


    I only tried this because of a forum post to get the nested list with the detailcard up an running - finally no chance - I try this now for many days and many of hours - without success ...

    I purchased the premium feature - how can I access the premium forum to get help ...

    hope to get it up and running by this way.

  9. #8
    Sencha User
    Join Date
    Mar 2012
    Posts
    18
    Answers
    1
    Vote Rating
    0
    heppi75 is on a distinguished road

      0  

    Default


    so I am a step closer and find out to use setDetailCard instead of getting the detail card

    but I can't get the index or the record from the leafitemtap:

    Code:
    // leafitemtap calls the function showDetails in the controller ...
    showDetails: function(list, index, target, record) {
    		var accopanel  	= this.getAccos();
    		var store  		= list.getStore(),
    			record 		= store.getAt(index);
    		
    		console.log(index);
    		console.log(record);
                    .....
    but index is an object an not a number and record is undefined - could anyone explain what is going wrong here? all would be fine if I could get either the correct index as a number or the record data itself ...

  10. #9
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Answers
    3542
    Vote Rating
    846
    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


    Look at what the leafitemtap arguments are again. You don't need to worry about the index, the record is the fifth argument.
    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.

Thread Participants: 2