jQuery UI Widgets Forums Dialogs and Notifications Window Jqxwindow: custom content, auto height and a button

This topic contains 2 replies, has 2 voices, and was last updated by  asies 9 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • asies


    I’d like to create a window with the following behaviour:
    – It has an ‘OK’ button to close the window.
    – It is opened on different occasions in one session, showing different feedback messages of different lengths each time.
    – It has fixed width.
    – Its height changes to accommodate the content (without excess space or scroll bars).

    I haven’t been able to reconcile ‘setContent’ (for new content and automatic height) with retaining the ‘OK’ button and its functionality when the window is re-opened.
    Setting the displayed message using its ID means that the window doesn’t automatically resize, so a scroll bar shows when a longer message is displayed, and the window has too much white space for shorter messages.

    Please could you advise? Thanks.


    Hello asies,

    When you are using ‘setContent’ you set the new window content so if you want to have Ok button when you re-open the window you can include button with the new content. Here is an example:

    $('#showWindowButton').click(function () {
        $('#jqxwindow').jqxWindow('setContent', 'Sample content<br /><input type="button" value="Ok" id="jqxButton2" />');

    Scrollbars appear when content overflows. If you want to set ‘height’ property to “auto” you should select which HTML element to place in a window, because for example DIV tags are not auto-sized. DIV tags are usually stretched horizontally. I hope it would be helpful.

    Best Regards,

    jQWidgets team


    I’ve got this working now.
    As you suggested, I had to remove the DIV tags, and implemented my own OK button to close the window rather than trying to use the okButton of jqxWindow.
    Thank you for your prompt and helpful reply!

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

You must be logged in to reply to this topic.