Results 1 to 2 of 2

Thread: Safe to open a modal window and passing current view model as parent?

  1. #1
    Sencha User
    Join Date
    Dec 2007

    Default Safe to open a modal window and passing current view model as parent?

    Hi all,

    obviously the following code seems to work correctly:
    var win = Ext.widget('PromptAnswerWin', {
                            viewModel: {
                                type: 'PromptAnswerVM',
                                data: data,
                                parent : this.getViewModel()
                            items: [{
                                xtype: ('ATTRIBUTE' === _type) ? 'AttributePrompt' : 'MetricPrompt'
    The docs are saying, that "once set, this cannot be changed". Am I allowed to do this (setting the parent of the view model to the calling instance or am I breaking some kind of internal processing logic?
    The only other way of passing the current view model as the parent in the modal windows component hierarchy is to include the modal window as a floating item in the items section of the container holding the viewModel and the viewController, then looking it up via
    and showing it.

    Both ways work, is the first way ok ?

  2. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Central Ohio


    You may want to check this out if you already haven't (perhaps it is what you were referring to about including it as a floating component):

    I am not sure if either are officially supported though. In your method when you add it as a parent, I wonder if this would cause issues on multiple instances of a window to the same VM.
    Tristan Lee
    Sencha Inc - Sustaining Engineer

    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

Similar Threads

  1. Replies: 0
    Last Post: 5 Aug 2015, 11:33 AM
  2. Replies: 1
    Last Post: 26 Nov 2014, 4:04 PM
  3. Passing parameters to modal window and back
    By kvajj in forum Ext: Discussion
    Replies: 1
    Last Post: 7 Aug 2012, 2:46 PM
  4. Modal window mask width problem - shows Hz scrollbar in parent window
    By satishp in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 27 May 2009, 11:46 PM
  5. [Workaround] Modal Window constrained to Parent Window?
    By JustinWalsh in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 5 Oct 2007, 9:59 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts