Announcement

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

    DataItem: programmatically open a DataChoser dialog

    How can I programmatically open a DataChoser?

    #2
    I assume you mean DateChooser, what exactly do you mean? DateChooser.show() is not what your working for?

    Comment


      #3
      I have hidden the Icon(DateChooser) by DataItem. And I want to open the DateChooser dialog by double click.
      how can I do it?

      Comment


        #4
        Oh ok, sorry didn't understand you at first.
        Code:
        public class MyDateItem extends DateItem {
          public native void showPicker() /*-{
            var self = this.@com.smartgwt.client.core.DataClass::getJsObj()();
            self.showPicker();
          }-*/;
        };
        Then you can just call showPicker() in your doubleclickhandler.

        Comment


          #5
          Thank you, exactly what I wanted.

          Can you perhaps help me with this problem?
          http://forums.smartclient.com/showthread.php?t=12258

          Comment


            #6
            I was looking for a way to do that too. Thanks for the solution.

            Another question: I was wondering if there was a way to position the DateChooser right under the DateItem.

            Thanks!

            Comment


              #7
              And a related question: Is there a way to position/snap a Canvas relative to a FormItem?

              Comment


                #8
                No way to get position unless it is derived from CanvasItem. However you can snap something based on an event like a click very easily to any FormItem. The handler will contain getX() and getY() methods, so it may not be the exact position of the FormItem but within the Rectangle that contains the FormItem since that is the only way a clickevent would have occurred.

                Comment


                  #9
                  Originally posted by svjard
                  No way to get position unless it is derived from CanvasItem. However you can snap something based on an event like a click very easily to any FormItem. The handler will contain getX() and getY() methods, so it may not be the exact position of the FormItem but within the Rectangle that contains the FormItem since that is the only way a clickevent would have occurred.
                  That's unfortunate.

                  Is there any way to get the DateChooser instance associated with the DateItem so I can position it?

                  Comment


                    #10
                    DateItem.showPicker() has been added to SVN.

                    Comment

                    Working...
                    X