Announcement

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

    How to resize the button width in the DateTime picker window.

    Hi ,

    I am facing an issue with "DateTime picker" control, Actually i want to change the button names on the "Date time picker" window. When i give little longer string(Ex: SGWT-Button-12), the string in the button is truncated.

    Same issue i am facing in the popup window also. If there is any possibility is there please share with me.Thank you.

    Sample screen shot attached.

    SmartGWT Version : SmartGWT4.1
    Browser: Mozilla, Chrome and Internet Explorer.

    using "SmartGWT 4.1" version

    Thanks in Advance.....
    Attached Files

    #2
    Hi vnathank,

    regarding the DateTimePicker please see my question in this thread and the answer from Isomorphic: http://forums.smartclient.com/showth...9167&page=3#25

    Generally speaking you'll have to change AutoChilds (http://www.smartclient.com/smartgwte...hildUsage.html)

    Best regards,
    Blama

    Comment


      #3
      Hello Isomorphic,

      I am not able to increase the size of the buttons(Today, Cancel) present in the "DateChooseItem" window. below is the code written to display the datetime picker icon.

      In the below sample code i am adding the dateTime picker icon to the "DataItem" field.
      ---------------------------------------------------
      dateField = new DateItem("counterDateItem", "");
      dateField.setRequired(true);
      dateField.setShowErrorStyle(false);
      dateField.setEnforceDate(true);
      dateField.setValidateOnChange(true);
      dateField.setShowPickerIcon(true);
      dateField.setTitleColSpan(2);
      dateField.setWidth(180);
      dateField.setShowTitle(false);
      dateField.setUseTextField(true);
      dateField.setTextAlign(Alignment.CENTER);
      ---------------------------------------------------

      If there is any possibility to change the size of the button please share with us and please find the attached screen shots.

      Thanks in advance....
      Attached Files

      Comment


        #4
        See the answer above - you use AutoChildren to configure the DateChooser.

        Comment


          #5
          Dear Isomorphic,

          Thankyou for the quick reply, But "AutoChildren" property is not available for "DateItem". Here i am not using "DataChooser".I am using "DateItem" for this item i am adding "setShowPickerIcon" to display picker icon.

          Comment


            #6
            See the doc for changeAutoChildDefaults() - you want something like:

            Code:
            dateItem.changeAutoChildDefaults("picker", new DateChooser() {...});
            Last edited by Isomorphic; 12 Feb 2014, 04:59.

            Comment


              #7
              or, actually, you can use setPickerProperties() directly, something like this:

              Code:
              DateChooser chooser = new DateChooser();
              Button cancelButtonProps = new Button();
              cancelButtonProps.setAutoFit(true);
              chooser.changeAutoChildDefaults("cancelButton", cancelButtonProps); 
              dateItem.setPickerProperties(chooser);

              Comment

              Working...
              X