[CLOSED] Desktop Window | Toolbar | Dropdownfield Component

  1. #1

    [CLOSED] Desktop Window | Toolbar | Dropdownfield Component

    Hey,

    There is an issue with dropdownfield, when placed in a toolbar in DesktopWindow specifically. The component inside dropdownfield is not registered on the client side.

    Check the following example. The calendarTree is not registered on the client side.

    <ext:Desktop 
        ID="MyDesktop" 
        runat="server" 
        BackgroundColor="White" 
        ShortcutTextColor="Black">
    </ext:Desktop>
    
    <ext:desktopwindow runat="server" ForceLayout="true" ID="winDesk" Height="400" Width="500">
        <TopBar>
            <ext:Toolbar runat="server">
                <items>
                    <ext:DropDownField ID="calDD" LazyInit="false" CtCls="cmbPad" runat="server" Editable="false" Width="150"  Icon="Combo">
                        <Component>
                            <ext:TreePanel ID="calendarTree"
                                runat="server" 
                                Header="false"
                                Icon="Accept"
                                Height="300"
                                Shadow="None"
                                UseArrows="true"
                                AutoScroll="true"
                                Animate="true"
                                EnableDD="true"
                                ContainerScroll="true" 
                                RootVisible="false">
                                <Root>
                                <ext:TreeNode NodeID="1"></ext:TreeNode>
                                </Root>
                                <Editors>
                                    <ext:TreeEditor ID="TreeEditor1" runat="server"  AutoEdit="false">
                                        <Field>
                                            <ext:TextField ID="TextField1" runat="server" />
                                        </Field>
                                   
                                    </ext:TreeEditor>
                                </Editors>
                             </ext:TreePanel>
                        </Component>
                    </ext:DropDownField>
                </items>
            </ext:Toolbar>
        </TopBar>
    </ext:DesktopWindow>
  2. #2

    RE: [CLOSED] Desktop Window | Toolbar | Dropdownfield Component

    Hi,

    I cannot reproduce anything wrong. For me tree is shown correctly. Can you post full test sample with steps to reproduce the issue?
  3. #3

    RE: [CLOSED] Desktop Window | Toolbar | Dropdownfield Component

    I could'nt explain you properly.

    Tree is rendered and works fine...


    But if you try to access it on client side you cannot, because its ID is not registered in th DOM.


    In the example I gave you, run it... and then in firebug console type calendarTree


    You will get an error... calendarTree is not defined.
  4. #4

    RE: [CLOSED] Desktop Window | Toolbar | Dropdownfield Component

    Hi,

    Did you open the desktop window before trying to access to the TreePanel?
    Window (and all inner controls) is rendered after show calling only. Therefore you cannot access to the inner controls before window showing.

    You can use one of the following

    1. Place you code which requires TreePanel in the 'on'

    var fn = function(){calendarTree.someAction();};
    if(calendarTree){
       fn();
    }
    else{
         winDesk.on('show', fn, this, {single: true});
    }

    or

    2. Set LazyMode="Instance" for calendarTree. It will force tree instantiate (without rendering). Also you need to set LazyMode="Config" for TreeEditor1 (or update from SVN if you do not want do it for tree editor)


  5. #5

    RE: [CLOSED] Desktop Window | Toolbar | Dropdownfield Component

    Well I am able to access all of them apart from calendarTree...

    and even after show... I cannot access calendarTree...


    calDD I can access without opening the window... You may check in the example I gave...
  6. #6

    RE: [CLOSED] Desktop Window | Toolbar | Dropdownfield Component

    Hi,

    calDD is instantiated by toolbar without rendering (till window showing). But DropDownField instantiate inner component during own rendering (or in the focus event handler). It is a reason why you have no access to the tree (it is instantiated after window showing for perfomance boost)


    Therefore just set LazyMode="Instance" for forcing instantiating (without rendering)

Similar Threads

  1. Replies: 2
    Last Post: Jul 26, 2012, 2:12 AM
  2. Window component inside desktop control
    By Shuaib in forum 1.x Help
    Replies: 0
    Last Post: Apr 20, 2012, 3:30 PM
  3. [CLOSED] resizeable dropdownfield component
    By PLoch in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 18, 2011, 5:02 PM
  4. Replies: 1
    Last Post: Jun 18, 2010, 6:41 AM
  5. [CLOSED] Desktop window close button on toolbar
    By llusetti in forum 1.x Legacy Premium Help
    Replies: 15
    Last Post: Jun 08, 2010, 6:41 PM

Posting Permissions