1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    1
    Vote Rating
    0
    ablom is on a distinguished road

      0  

    Default Answered: How To Add DataView to Panel

    Answered: How To Add DataView to Panel


    Hi Guys,

    My goal is to have a dataview with a submit button. I created the dataview and can push it successfully to the view. I then tried to create a panel so that I could add the dataview and then a submit button to push that panel but only the submit button appears after pushing. Any ideas how I can fix this? Below is some of my code.

    Code:
            var view = list.parent;
    
            Ext.define('MyListItem', {
                extend: 'Ext.dataview.component.DataItem',
                xtype: 'mylistitem',
    
    
                config: {
                    nameButton: {
                    },
                    inventory: {
                        name: 'Prod_Desc'
                    },
                    dataMap: {
                        getNameButton: {
                            setLabel: 'Prod_Desc'
                        }
                    },
                    layout: {
                        align: 'center'
                    }
                },
    
    
                applyNameButton: function(config) {
                    return Ext.factory(config, Ext.field.Text, this.getNameButton());
                },
    
    
                updateNameButton: function(newNameButton, oldNameButton) {
                    if (oldNameButton) {
                        this.remove(oldNameButton);
                    }
    
    
                    if (newNameButton) {
                        this.add(newNameButton);
                    }
                }
            });
    
    
            var dv = Ext.create('Ext.DataView', {
                fullscreen: true,
    
    
                store: detailsStore,
    
    
                useComponents: true,
                defaultType: 'mylistitem'
            });
            
            var submitBtn = Ext.create('Ext.Button', {
                text: 'Submit',
                ui: 'confirm '
            });
            
             var mainPanel = Ext.create('Ext.Container', {
                 fullscreen: true,
             });
            
            mainPanel.add(dv);
            mainPanel.add(submitBtn);
            view.push(mainPanel);

  2. Remove fullscreen config from the Ext.DataView. You also need to not allow scrolling on the DataView and allow scrolling on the Container it is being set in.

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


    Remove fullscreen config from the Ext.DataView. You also need to not allow scrolling on the DataView and allow scrolling on the Container it is being set in.
    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: 1