xn--6by35j.com

25 Nov 2008

by smith

edit

xn--6by35j.com

Add a non-Ext child control?
  • Newbie here! I am sure this is simple, given how cool and flexible ExtJS appears to be! I just can't seem to find the answer in the help :)

    I have another "control" written by another party, that has nothing to do with ExtJS (and in fact is not written using the ExtJS library). This control has a method to be able to add itself into a DOM tree... So something like the "constructor" takes a DOM parent "thing" (node? element?) and then it creates its own div and then calls "appendChild" on the parent thing to add itself. My question is -- when can I do this with an ExtJS control?

    For example, let's say I want it to appear within a FormPanel. Normally we construct our FormPanels by filling in the "items" collection. This doesn't seem to fit the paradigm I need -- I need to be notified when the ExtJS FormPanel has been fully "DOM-ified," and then I need to grab a DOM node from that and then pass it into the "constructor" of my other control...

    Thanks in advance,
    Mike Johnson


  • to add to doug's comment - You could answer most of your questions by poking around the object space with firebug ;)


  • Most UI Ext.Components have a render event which indicates the appropriate time to modify its DOM further. You can safely indentify your foreign control render target then.


  • Child components and content are usually rendered to the .body property.

    If your foreign-comp does an appendChild (as most do), use extComp.body.dom as an initial target. You may need to use Firebug to browse the DOM after render to select a more specific target.


  • OK, great! Now part 2 then -- what do I call to get the DOM element associated with a control (FormPanel, tab, etc. etc.)? That's what I will want to pass to my other control as the "parent".

    Thanks in advance,
    Mike


  • COMMENTS

    VoIP: Hype, Hustle, and Heavenly Help
    Netreon Hires VP of Marketing

    Copyright © xn--6by35j.com Inc. All rights reserved.

    Pages
    Archives
    • 2007-01
    • 2007-02
    • 2007-03
    • 2007-04
    • 2007-05
    • 2007-06
    • 2007-07
    • 2007-08
    • 2007-09
    • 2007-10
    • 2007-11
    • 2007-12
    • 2008-01
    • 2008-02
    • 2008-03
    • 2008-04
    • 2008-05
    • 2008-06
    • 2008-07
    • 2008-08
    • 2008-09
    • 2008-10
    • 2008-11
    Categories
    • Self Help
    • Resumes
    • Cruising
    • Numerology
    • Digital Photography
    • Cyber Law
    • RVs
    • Languages
    Blogroll
    Meta
    • HOME
    • Valid XHTML
    • XFN
    • WordPress