Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Modal window with ViewLoader contents

    Although I'm not actually using the ViewLoader, it substitutes nicely for my ViewDependencyLoader which is based on the same concept. I would like to show a modal window that contains a view created through the ViewLoader. Take the following sample and try it in the ViewLoader feature explorer example:
    Code:
    isc.Button.create({
        title: "Show modal",
        click: function () {
            var w = isc.Window.create({
                autoSize: true,
                isModal: true,
                showModalMask: true,
                autoDraw: false,
                autoCenter: true,
                items: [
                    isc.ViewLoader.create({
                        autoDraw:false,
                        viewURL:isc.Page.getIsomorphicDocsDir()+"inlineExamples/advanced/loadedView.js",
                        loadingMessage:"Loading Grid.."
                    })
                ],
             });
             w.show();
        }
    });
    Note that the modal window is always 100x100. Replace the ViewLoader creation with the code copied from the loadedView tab and try again. Note that the modal window is now sized based on the embedded view.

    Is there a way to force the resizing from the child view of the ViewLoader up to the container modal window?

    #2
    This looks to be due to ViewLoader's implementation of layoutChildren(), which explicitly sizes the loaded view.

    For core SmartClient, we probably need a flag that disables this.

    For your ViewDependencyLoader, you might consider subclassing Layout rather than Label. You could still use a *separate* Label for the loading message. Then, whether the view is sized to match the ViewLoader or the ViewLoader auto-sizes to the view could be determined by setting the layout policy properties (hPolicy and vPolicy).

    Comment

    Working...
    X