1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    1
    Vote Rating
    0
    rbasto is on a distinguished road

      0  

    Default Unanswered: Viewport adding grid to container problem

    Unanswered: Viewport adding grid to container problem


    Hi,
    I am newbie with extjs4.

    I am using mvc with autoCreateViewport: true,

    In the View port i have on west a tree (menu) and on center a container.
    When i try to load a grid to panel, for the fist time everything goes fine, but second time i get following error:

    Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMHTMLDivElement.insertBefore]

    target.insertBefore(item.el.dom, position || null);

    If try to load simple panel everything works fine


    Ext.define('AM.view.Viewport', {
    extend: 'Ext.container.Viewport',


    layout : 'border',

    requires: [
    //'AM.view.MenuLateral',
    'AM.view.PainelDeTeste',
    'AM.view.Web_rh_identificacao.List',
    'AM.view.Web_rh_identificacao.Edit',
    'AM.view.Web_rh_identificacao.Identificacao'



    ],


    initComponent: function() {
    var me = this;

    me.items = [
    {
    xtype: 'box',
    id: 'header',
    region: 'north',
    html: '<h1>Portal 2.0</h1>',
    height: 30
    }
    ,




    //------------------------------------------------------------------------------------------

    {
    region:'west',
    border: false,
    margins: '0 0 0 0',
    width: 275,
    minWidth: 150,
    maxWidth: 400,
    xtype: 'treepanel',
    title: 'Menu',
    rootVisible: false,
    autoScroll: true,
    collapsible: true,
    animate: true,
    useArrows: true,
    itemId: 'treePanelPrincipal',
    dockedItems: [{
    xtype: 'toolbar',
    items: [{
    text: 'Expandir todos',
    iconCls: 'expand',
    handler: function(){
    this.up('#treePanelPrincipal').expandAll();
    }
    }, {
    text: 'Contrair todos',
    iconCls: 'collapse',
    handler: function(){
    this.up('#treePanelPrincipal').collapseAll();
    }
    }]
    }],
    listeners: {
    itemclick: function(view, record, item, index, evt, options) {
    if (record.get('leaf')) {
    console.log('>----------->'+record.raw['xtypeClass']);
    Ext.getCmp('Centro').removeAll();
    Ext.getCmp('Centro').add(
    {
    title: record.get('text') || 'Tela do sistema',
    autoDestroy: true,
    items: {
    xtype: record.raw['xtypeClass']
    }
    }
    ).show();



    }
    }
    },
    store: Ext.create('Ext.data.TreeStore', {
    proxy: {
    type: 'ajax',
    url: 'menu.php',
    noCache : false,
    actionMethods: {
    read: 'POST'
    }
    }
    })
    }
    //-------------------------------------------------------------------------------------------


    ,
    {
    xtype: 'container',
    region: 'center',
    border: false,
    id: 'Centro',
    layout: 'fit',
    items:[{ xtype: 'paineldeteste'}]

    }
    ];




    me.callParent(arguments);
    }
    });


    thanks !

  2. #2
    Sencha User skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,338
    Answers
    498
    Vote Rating
    248
    skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of

      0  

    Default


    Please use CODE tags when posting code (# button on the editor toolbar).

    That sample is a little on the long side and there are key dependencies missing. Are you able to extract a simple, complete test case? Try to reduce the code down, trim out any config settings and components that aren't required. For example, could you remove the toolbar? Often the process of reducing down the code identifies the problem. If possible also try to remove the external dependencies such as the Ajax call, that makes it very difficult for us to figure out what's going on. Such calls can usually be replaced with a small amount of local, hard-coded data. I also don't see the code for the grid you mentioned. I suspect the problem may actually be in the grid definition.

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar