1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    2
    Vote Rating
    0
    lmanik is on a distinguished road

      0  

    Exclamation Unanswered: Problem with dockedItems

    Unanswered: Problem with dockedItems


    Hi,

    i have got problem with dockedItems in grid.panel.

    This is my viewport:
    PHP Code:
        {
            
    id'content-panel',
            
    region'center',
            
    bordertrue,
            
    layout'fit'
        
    }, 
    in controller i have this:
    PHP Code:
        init: function() {
            
    this.control({    
                
    'navigation-tree': {
                    
    itemclick: function (viewrecord) {
                        if (
    record.get('id')) {            
                                var 
    cmp Ext.getCmp('content-panel');
                                
    cmp.removeAll();
                                
    cmp.add({xtyperecord.get('id')});
                                
    console.log(record.get('id'));
                        }
                    } 
                }
            })
        } 
    and view is this:

    PHP Code:
    Ext.require('Filters');


    Ext.define('IS.view.checkout.View', {
        
    extend'Ext.grid.Panel',
        
    alias'widget.prodejna_pokladna',
        
    store'checkout.View',
        
        
    title'Pokladna',
        
    borderfalse,
        
    layout'fit',
        
    id'prodejna_pokladna',
        
    selModelExt.create('Ext.selection.CheckboxModel'),
        
        
    columns: [
            {
    header'ID'dataIndex'id'hiddentrue},
            {
    header'Datum'dataIndex'date'flex1},
            {
    header'Description'dataIndex'desc'flex3},
            {
    header'Cash'dataIndex'cash'flex1align'right'renderer: function(value){ return Filters.number_color(value); }},
        ],
        
        
    features: [{
            
    ftype'grouping'
        
    }],
        
        
    dockedItems: [
        {
            
    xtype'pagingtoolbar',
            
    store'checkout.View',
            
    dock'bottom',
            
    displayInfotrue,
        },
        {
            
    xtype'cash.toolbar',
            
    dock'top',
        }],
        
        
    initComponent: function () { this.callParent(arguments); this.store.loadPage(1); }
    }) 
    when i clicked in navigation to id prodejna_pokladna, its working, when i clicked to other id, its working, but when i clicked again to id prodejna_pokladna i get this message:

    PHP Code:
    Uncaught TypeErrorCannot read property 'childNodes' of undefined 
    when i remove dockedItems from the view, its working.
    Can you someone help me please?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    Answers
    3447
    Vote Rating
    814
    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 really shouldn't use ids unless you are debugging. You should also stay away from defining arrays and objects on the prototype as they can be shared among instances and not behave the way you want them to.
    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