jQuery UI Widgets Forums Navigation Expander Problems with Expander Height

This topic contains 4 replies, has 2 voices, and was last updated by  stephan 6 years, 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Problems with Expander Height #24243

    stephan
    Participant

    Hi,

    When creating an expander and then adding it to the DOM the expander has an incorrect height, ie. it is too high bei some 12 pixels.

    This fiddle demonstrates the problem:
    http://jsfiddle.net/_stephan_/qVW7Y/5/

    The expander overlaps with the text that follows th expander element.

    Regards,
    Stephan

    Problems with Expander Height #24244

    Peter Stoev
    Keymaster

    Hi,

    The widgets is incorrectly initialized. It is expected to initialize a widget from an existing DOM element. Otherwise the jQuery’s width() and height() functions will not return correct results.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Problems with Expander Height #24252

    stephan
    Participant

    Hi Peter,

    Well, I read as a “best practice” that adding elements to the DOm as late as possible is a great perfromance enhancement for web applications. If you add to the DOM early on, then modify the added element continuously, you get DOM re-rendering overhead for each single modification to the DOM.

    In my case I create dynamically a very complex content for the expander. In fact an entire dialog representation goes into the expander and gets created control by control from runtime data. Thus I want to avoid modifying the DOM hundreds of time, by first constructing the expander with content, and THEN adding it to the DOM when all content is in there. Additionally if lots of small content gets added dynamically this process actually becomes visible due to the continuous re-rendering of the DOM by the browser.

    Is there a chance to avoid the continuous DOM re-rendering using jqxWidgets ? Otherwise I’ll have to update my application logic and live with the overhead and the side effects.

    Regards,
    Stephan

    Problems with Expander Height #24254

    Peter Stoev
    Keymaster

    Hi,

    What I say is that the widget should be initialized from an element added to the DOM. It does not matter when you add the HTML element, just add the initialization code after you add the HTML Element to the DOM, not before it.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Problems with Expander Height #24261

    stephan
    Participant

    Hi,

    I am already in the process of restructuring my app to comply with the peculiarities of jQWidgets.

    That said I would consider it to be rather pointless to call jqWidgets initializers after creating just the HTML as one block and adding it. After all: what do the jQWidgets initializers do ? They perform more or less extensive DOM object modifications by adding in extra “div”s, setting properties, etc. In other words: calling the jQWidgets initializers again causes a larger amount of DOM modifications to occur. As stated before: each single DOM modification causes the browser to re-render the entire HTML …. which is what I attempted to prevent in the first place.

    Regards,
    Stephan

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.