Hi,
i would like to override the DateTimePicker and also want to change style from left: 4px to left: 2px.
extend: wisej.web.DateTimePicker,
construct: function () {
this.base(arguments);
var textfield = this.getChildControl(“textfield”);
textfield.getContentElement().setStyles({ left: “2px”});
},
The javascript has been called, but it does not change the style.
Thanks for yours help,
Page,
Setting the style of the content element directly is overridden by the theme setting the properties and styles of the actual widget. In particular the margin property is translated to style positions since you cannot use margin in css with absolute positions by the underlying javascript layout engine.
Either you do it after the dom is rendered or it’s much simpler to change the theme.
You can:
Solution 2 is the preferred one. New Item -> Mixin theme. see below and attached. Arrays are in the standard TRBL sequence.
{ "name": "Application", "appearances": { "datefield": { "inherit": "datefield", "components": { "textfield": { "states": { "default": { "properties": { "margin": [ 0, 0, 0, 2 ] } } } } } } } }
Please login first to submit.