Results 1 to 5 of 5

Thread: Get if a window is modal

  1. #1
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    141
    Answers
    9
    Vote Rating
    1
      0  

    Default Answered: Get if a window is modal

    Outside the window class, (or even inside an event of that window) I would like to see if it's modal

    I know it's a config but I need it to disable the taskbar when my window becomes active if it's modal :\ (it's a desktop-like app)

  2. No problem, I found the solution: in the constructor the config is applied after callParent, so in constructor is a bit problematic effectively find out the modal value.

    I solved by moving code to initComponent, there I can access it simply with "this.modal" and do some stuff

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,411
    Answers
    3898
    Vote Rating
    1290
      0  

    Default

    Like this?

    Code:
    var win = new Ext.window.Window({
        width  : 400,
        height : 400,
        title  : 'Test',
        html   : 'test',
        modal  : true
    });
    
    win.show();
    
    console.log(win.modal);
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    141
    Answers
    9
    Vote Rating
    1
      0  

    Default

    Mhh, I set modal in my window class (Ext.define), however when I write myinstance.modal it returns 'undefined', not true nor false (I set it to true).

    Note that I'm checking it not in the scope of the class, I'm from a controller which is getting a ref to that view and then check the modal value.

    I found I can access "modal" only in the constructor of the window

  5. #4
    Sencha User
    Join Date
    Dec 2011
    Posts
    224
    Answers
    13
    Vote Rating
    10
      0  

    Default

    Prolly the problem is on the line of code where u are getting the reference to the view.

    You can do console.log(myInstance) and check on firebug console or similar the whole structure of your object. Check there if others confings of you view are set. if none of them are there, then u have a problem on getting the reference to the view class.

    (sorry for my bad english)

  6. #5
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    141
    Answers
    9
    Vote Rating
    1
      0  

    Default

    No problem, I found the solution: in the constructor the config is applied after callParent, so in constructor is a bit problematic effectively find out the modal value.

    I solved by moving code to initComponent, there I can access it simply with "this.modal" and do some stuff

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
  •