Announcement

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

    Problem setting cell style on DateTimeItem

    SmartClient Version: v9.0p_2013-12-11/LGPL Development Only (built 2013-12-11)

    Browser IE11

    I am setting the default cell style on FormItem to add some common padding. I have cases where I don't want any padding on form items, so I set up a second form cell style that doesn't have any padding and when I don't want the padding I override the cell style on individual form item instances. This has worked fine for me on every control I've tried except the DateTimeItem. In this case, the DOM that is created ends up with an element that uses my class with no padding, but it also has an inner element in the DOM that still refers to the FormItem default cell style class I set up. The result is that with the DateTimeItem I still end up with the padding showing.

    Sample source code is attached, and the styles used are:

    Code:
    .formItemDefault {
      padding: 10px;
    }
    
    .dateTimeFormItem {
      padding: 0
    }
    The resulting display shows padding and has elements in the DOM using both styles. What I expect is to not see any padding and have the DOM only reference the style with no padding.
    Attached Files

    #2
    We wouldn't recommend this approach, because this is likely the first of several issues it will create. Many framework widgets are composed of other FormItem (eg DateItem internally uses several SelectItems) so you'll end up with doubles padding in many circumstances.

    Instead, just apply the padding to the specific FormItem subclasses where you want it.

    Comment

    Working...
    X