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?

    Tahoe Date Chooser.png Enterprise Date Chooser.png

    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:
      Test 1.png Test 2.png

      Desired results (from 6.1 showcase Tahoe skin):
      Desired 1.png Desired 2.png

      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; 17th 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; 17th Jul 2017, 11:19.

        Comment

        Working...
        X