Announcement

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

    Fixed Height Date Chooser

    In Tahoe skin, the date chooser height is fixed, while in other skins, the date chooser height will change depending on the number of weeks for the month. How can I fix the date chooser height in other skins so that it will appear like Tahoe skin?

    Click image for larger version

Name:	Tahoe Date Chooser.png
Views:	255
Size:	26.7 KB
ID:	245325 Click image for larger version

Name:	Enterprise Date Chooser.png
Views:	257
Size:	34.4 KB
ID:	245326

    In the showcase example: http://www.smartclient.com/smartgwt/...endar_category , all skins except Tahoe, if the date chooser change of month/year cause a change in the number of weeks (rows), the date chooser will close. With Tahoe skin, the date chooser will display fine.
    Attached Files

    #2
    Set a default height on the DateChooser widget via setDefaultProperties.

    Comment


      #3
      I am able to set the initial default height, but it will still change if the number of weeks change. I would like to have the height fixed no matter how many weeks (rows) for the month.

      Test results:
      Click image for larger version

Name:	Test 1.png
Views:	263
Size:	24.3 KB
ID:	245796 Click image for larger version

Name:	Test 2.png
Views:	246
Size:	19.2 KB
ID:	245798

      Desired results (from 6.1 showcase Tahoe skin):
      Click image for larger version

Name:	Desired 1.png
Views:	255
Size:	22.3 KB
ID:	245800 Click image for larger version

Name:	Desired 2.png
Views:	247
Size:	20.9 KB
ID:	245802

      Following is the test codes:

      package com.test.client;

      import com.smartgwt.client.types.Alignment;
      import com.smartgwt.client.widgets.DateChooser;
      import com.smartgwt.client.widgets.IButton;
      import com.smartgwt.client.widgets.form.fields.DateItem;
      import com.smartgwt.client.widgets.grid.DateGrid;
      import com.smartgwt.client.widgets.layout.HLayout;

      public class DefaultDateItem extends DateItem {

      public DefaultDateItem() {

      DateChooser d = new DateChooser();
      d.setWidth(460);
      d.setHeight(440);
      d.setDefaultHeight(440);

      DateGrid dateGrid = new DateGrid();
      dateGrid.setMinFieldWidth(100);
      dateGrid.setFixedRecordHeights(true); //fixed height for the Days.
      dateGrid.setCellHeight(10); //fixed the height to 10 px, but the result still autoheight

      HLayout headerProperties = new HLayout();
      headerProperties.setWidth100();

      IButton b = new IButton();
      b.setAutoFit(true);
      DateChooser.changeAutoChildDefaults("dateGrid", dateGrid);
      DateChooser.changeAutoChildDefaults("monthChooserButton", b);

      setPickerProperties(d);
      setEnforceDate(true);
      setPickerIconPrompt(null);
      setUseTextField(true);
      setTextAlign(Alignment.LEFT);
      setUseMask(true);
      setChangeOnKeypress(true);
      setValidateOnChange(true);

      }

      }
      Attached Files
      Last edited by OPY; 17 Jul 2017, 10:28.

      Comment


        #4
        Tahoe sets an attribute that updates a few things to get the UI it has.

        To set the height permanently, you need to do so on the dateGrid, not the dateChooser - DateChooser.setAutoChildProperties("dateGrid", instance), or DateGrid.setDefaultProperties(instance), where instance is a DateGrid with setHeight() having been called.

        For what it's worth, Tahoe sets the height to 191.
        Last edited by Isomorphic; 17 Jul 2017, 11:19.

        Comment

        Working...
        X