Announcement

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

    How to stretch TextItem height to match title?

    Is it possible to make the height of the TextItem to match the height of the label if the label wraps?

    This can be illustrated using a slighty modified SmartClient Section example on http://www.smartclient.com/docs/9.1/a/system/reference/SmartClient_Explorer.html#formSections using SmartClient Version: v9.1p_2015-08-21/Pro Deployment (built 2015-08-21) on Chrome 44.0 as follows:

    Code:
    isc.DynamicForm.create({
            width: 300,
            fields: [
                { defaultValue:"Item", type:"section", sectionExpanded:true,
                    itemIds: ["itemName", "description", "price"] 
                },
                { name:"itemName", type:"text", title:"Item"},
                { name:"description", type:"text", title:"Very very very very very very very very very very very very very very very very very very long title"},
                { name:"price", type:"float", title:"Price", defaultValue:"low"}
            ]
    });
    Is there a way we can make the TextItem of the "description" field to match that of the title such that the space between different FormItems remain uniform?

    ----------------
    SmartClient Version: v9.1p_2015-08-21/Pro Deployment (built 2015-08-21)
    Windows 7 Chrome 44.0.2403.157

    #2
    Any update, Isomorphic?

    Comment


      #3
      Hi Cyuen,
      Unfortunately this is not a feature that is supported out of the box.
      Probably the easiest way to get the appearance you want is to ensure the form as a whole has a specified height large enough to accomodate the wrapping title (so it doesn't overflow) and to specify height:"*" on your item to ensure it fills the available space.
      Something like this:

      Code:
      isc.DynamicForm.create({
              width: 300,
              height:200,
              fields: [
                  { defaultValue:"Item", type:"section", sectionExpanded:true,
                      itemIds: ["itemName", "description", "price"] 
                  },
                  { name:"itemName", type:"text", title:"Item"},
                  { name:"description", type:"text",
       title:"Very very very very very very very very very very very very very very very very very very long title",
      height:"*",
      },
                  { name:"price", type:"float", title:"Price", defaultValue:"low"}
              ]
      });
      It's also worth noting that the text item will not wrap even if it has a tall height - you may want to use a TextAreaItem instead as a tall textItem may be confusing UI for the user.

      Regards
      Isomorphic Software

      Comment

      Working...
      X