Results 1 to 4 of 4

Thread: Adding hidden modal panel to Viewport -> Error: "Item does not exist in the containe"

  1. #1

    Default Adding hidden modal panel to Viewport -> Error: "Item does not exist in the containe"

    I'm getting some errors in my app since i upgraded to 7.0 ("Item does not exist in the container")

    One simple way for me to reproduce this error is by doing the following:

    Code:
    Ext.Viewport.add({
        xtype: 'panel',
        modal: true,
        hidden: true
    });
    What's wrong about that? The combination of modal and hidden produces this error. Maybe when i understand why this code produces an error since 7.0 i can understand the other errors in my app.

    Best regards
    Maurice

  2. #2

    Default

    So far as a workaround i do the following:

    Code:
    Ext.Viewport.add({
    xtype: 'panel', hidden: true, listeners: {
    added: function (component) {
    component.setModal(true);
    }
    }
    });

  3. #3
    Ext JS Premium Member
    Join Date
    Jul 2011
    Location
    Virginia Beach
    Posts
    9

    Default Missing `floated` Config

    @Maurice.Rossi -

    I encountered this exact problem this morning. I don't believe it has to do with your hidden: true config, rather, it has everything to do with modal: true which was producing the same error for me. I added in the floated: true config and that fixed it.

    Code:
    Ext.Viewport.add({
        xtype: 'panel',
        modal: true,
        floated: true
    });
    I encountered this using ExtJS 7.1.0 Modern Toolkit.

    Hope this helps,

    Jasel

    Quote Originally Posted by Maurice.Rossi View Post
    So far as a workaround i do the following:

    Code:
    Ext.Viewport.add({
    xtype: 'panel', hidden: true, listeners: {
    added: function (component) {
    component.setModal(true);
    }
    }
    });

  4. #4

    Default

    Hi Jasel,

    my problem is based on the hidden config. My example with the Viewport is just one case. If i want to show a modal panel inside another panel adding the floating config is not a solution because the panel will then be added to the floating container and not as child to the panel i added it. I am just trying to create a hidden modal panel and show it at a later point.


    In this way i get the error too:

    Code:
    var panel = Ext.create('Ext.Panel');
    
    panel.add({
        xtype: 'panel',
        modal: true,
        hidden: true
    });
    Best regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •