Announcement

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

    How hide window when it lost focus?

    Hi,
    I have to do window(or something witch looks like window), wich will be hidding when it lost focus. Is any way to do this?

    I tried use Menu class, but I can't add Canvas to menu(Menu extends ListGrid).

    In Window class i can use FocusChangedHandler, but it doesn't work when I click in another part of my application(not on this window).

    I found attributs like "autoDismiss" and "autoDismissOnBlur". Can I use it for Window?


    I use smartgwt version: 2.2

    #2
    If you've found something, then try it out & check whether it works or not.

    Comment


      #3
      No... I don't have any solution...

      Comment


        #4
        Try this:
        Code:
        window.setAttribute("dismissOnOutsideClick", dismissOnOutsideClick, true);

        Comment


          #5
          Thank you very much!
          It works.
          ___
          EDIT:
          for future questions:
          It works only with setIsModal(true). But for me it is enought.
          Last edited by bartas; 26 May 2011, 13:26.

          Comment


            #6
            Use the method window.setDismissOnOutsideClick(true) instead.

            Comment


              #7
              Hey sjivan, Can you tell me what's the difference between the two?

              Comment


                #8
                They are functionally equivalent but it's better to use the public API window.setDismissOnOutsideClick(..)

                Comment

                Working...
                X