1. #1
    Sencha User
    Join Date
    Feb 2008
    Posts
    194
    Vote Rating
    -1
    hpet is an unknown quantity at this point

      0  

    Default Ext.Layer

    Ext.Layer


    Hello,

    I have a window with form. Some elements on this form and defined "inline" using xtype where some, like toolbar, grid, etc. are precreated using var grid = new Ext.... and so on.

    One of precreated objects is also Layer.
    var xlist = new Ext.Layer({...})
    and child of this list is textarea
    xlist.createChild({...})

    when window form layout is created I include these precreated objects:

    Code:
    ...
    items: [
       xlist,
       { xtype:"textfield", id:"ID1", fieldLabel:"Label1", width:"100%" }
    ]
    When I double click grid row I populate form fields using "loadRecord()".
    Everything is fine except for this xlist's child textarea field. It doesn't populate.
    Checking in firebug I see that xlist object is not part of the form element, but is child of body element. When window layout is set, why isn't it moved in the dom to the right position? shouldn't it be nested somewhere down there as defined? other objects seem to be.

    Thanks!

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,546
    Vote Rating
    62
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    The FormPanel cannot know about it.

    The FormPanel only knows about Fields that are in the Container hierarchy underneath it.

    Simply creating HTML controls won't add anything to the Form.

    But you need to rethink. Layers are for floating elements. What UI interaction are you looking for here?

  3. #3
    Sencha User
    Join Date
    Feb 2008
    Posts
    194
    Vote Rating
    -1
    hpet is an unknown quantity at this point

      0  

    Default


    ah, ok... layer is html control and therefore not simply added to the Form.

    I am trying to have a combobox with two triggers, one for clasic dropdown list and the other for "textarea dropdown". I went for Layer because it handles shadow and everything, and seemed simple enough.

    Idea with this "textarea dropdown" is to allow user to enter some kind of an extra comment.
    With Layer I tried to mimic clasic dropdown list.

    Any better way to go about it?

    Thanks!

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,546
    Vote Rating
    62
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    That's exactly what Ext.form.TwinTriggerField is for.

    Undocumented, so use the source.

  5. #5
    Sencha User
    Join Date
    Feb 2008
    Posts
    194
    Vote Rating
    -1
    hpet is an unknown quantity at this point

      0  

    Default


    Yes and I am using it.
    I just thought that Layer object would be simple enough choice to handle with second trigger. This part is working ok, but problem is that Layer object is not created within the Form where I want it to be and "loadRecord()" method doesn't find it.

    I need to play a bit more around it.

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,546
    Vote Rating
    62
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    loadRecord finds the Field

Thread Participants: 1