UI Widgets CSS Classes

This section describes the PhoneJS CSS classes you can use to define the appearance of an element.

dx-clearfix

Set this class to an element to automatically increase the height of this element if floating child elements overflow the current element box.

Show Example:
jQuery
<div class="dx-fieldset">
    <div class="dx-field" style="text-align:center;">
        Apply <b>"dx-clearfix"</b> class to parent element<br />
        <div data-bind="dxCheckBox: { checked: applyClass }"></div>
    </div>
</div>
<div id="parentElement">
    <div id="childElement"><p>Floating child element.</p></div>
    <p>Parent element</p>
</div>
applyClass = ko.observable(false);
applyClass.subscribe(function (newValue) {
    if (newValue)
        $("#parentElement").addClass("dx-clearfix");
    else
        $("#parentElement").removeClass("dx-clearfix");
});
p{
    margin:10px;
}
#parentElement {
    color:blue;
    margin: 10px;
    background-color: cyan;
    border:solid 2px blue;
}
#childElement {
    margin: 10px;
    float: left;
    width: 30%;
    color:brown;
    background-color: yellow;
    border:solid 2px brown;
}

dx-field

Defines the appearance of an element displaying a field-value pair within a dx-fieldset element.

The dx-field field element may include label and value elements intended to display the field name and value respectively. Use the dx-field-label and dx-field-value classes to create label and value elements.

HTML
<div class="dx-field">
    <div class=dx-field-label>Full Name</div>
    <div class=dx-field-value>John Smith</div>
</div>
Show Example:
jQuery
<div class="dx-fieldset">
    <div class="dx-field">
        <div class=dx-field-label>Firt Name</div>
        <div class=dx-field-value" data-bind="dxTextBox: {value: firstName}">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Last Name</div>
        <div class=dx-field-value" data-bind="dxTextBox: { value: lastName }">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Age</div>
        <div class=dx-field-value" data-bind="text: age"></div>
        <div data-bind="dxSlider: { min: 0, max: 100, value: age }">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Gender</div>
        <div class=dx-field-value" data-bind="dxSelectBox: { dataSource: genders, value: gender }">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Full Name</div>
        <div class=dx-field-value">
            <span data-bind="text: firstName"></span> <span data-bind="text: lastName"></span>
        </div>
    </div>
</div>
firstName = ko.observable("John");
lastName = ko.observable("Smith");
age = ko.observable(31);
gender = ko.observable("Male");
genders = ["Male", "Female"];

dx-field-label

A class used to display a field name within the dx-field element.

HTML
<div class="dx-field">
    <div class=dx-field-label>Full Name</div>
    <div class=dx-field-value>John Smith</div>
</div>

The dx-field-label element can hold plain text, UI widgets, knockout bindings or custom markup.

Show Example:
jQuery
<div class="dx-fieldset">
    <div class="dx-field">
        <div class=dx-field-label>Firt Name</div>
        <div class=dx-field-value" data-bind="dxTextBox: {value: firstName}">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Last Name</div>
        <div class=dx-field-value" data-bind="dxTextBox: { value: lastName }">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Age</div>
        <div class=dx-field-value" data-bind="text: age"></div>
        <div data-bind="dxSlider: { min: 0, max: 100, value: age }">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Gender</div>
        <div class=dx-field-value" data-bind="dxSelectBox: { dataSource: genders, value: gender }">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Full Name</div>
        <div class=dx-field-value">
            <span data-bind="text: firstName"></span> <span data-bind="text: lastName"></span>
        </div>
    </div>
</div>
firstName = ko.observable("John");
lastName = ko.observable("Smith");
age = ko.observable(31);
gender = ko.observable("Male");
genders = ["Male", "Female"];

dx-fieldset

Defines the appearance of an element displaying a list of field-value pairs.

To create a fieldset element, create an element and assign "dx-fieldset" to its' class attribute.

HTML
<div class="dx-fieldset">
    . . .
</div>

Each fieldset item is displayed within a separate field element, which has the dx-field class. The field element may include label and value elements intended to display the field name and value respectively. Use the dx-field-label and dx-field-value classes to create label and value elements.

HTML
<div class="dx-field">
    <div class=dx-field-label>Full Name</div>
    <div class=dx-field-value>John Smith</div>
</div>

The field label and value elements can hold plain text, UI widgets, knockout bindings or custom markup.

Show Example:
jQuery
<div class="dx-fieldset">
    <div class="dx-field">
        <div class=dx-field-label>Firt Name</div>
        <div class=dx-field-value" data-bind="dxTextBox: {value: firstName}">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Last Name</div>
        <div class=dx-field-value" data-bind="dxTextBox: { value: lastName }">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Age</div>
        <div class=dx-field-value" data-bind="text: age"></div>
        <div data-bind="dxSlider: { min: 0, max: 100, value: age }">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Gender</div>
        <div class=dx-field-value" data-bind="dxSelectBox: { dataSource: genders, value: gender }">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Full Name</div>
        <div class=dx-field-value">
            <span data-bind="text: firstName"></span> <span data-bind="text: lastName"></span>
        </div>
    </div>
</div>
firstName = ko.observable("John");
lastName = ko.observable("Smith");
age = ko.observable(31);
gender = ko.observable("Male");
genders = ["Male", "Female"];

dx-field-value

A class used to display a field value within the dx-field element.

HTML
<div class="dx-field">
    <div class=dx-field-label>Full Name</div>
    <div class=dx-field-value>John Smith</div>
</div>

The dx-field-value element can hold plain text, UI widgets, knockout bindings or custom markup.

Show Example:
jQuery
<div class="dx-fieldset">
    <div class="dx-field">
        <div class=dx-field-label>Firt Name</div>
        <div class=dx-field-value" data-bind="dxTextBox: {value: firstName}">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Last Name</div>
        <div class=dx-field-value" data-bind="dxTextBox: { value: lastName }">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Age</div>
        <div class=dx-field-value" data-bind="text: age"></div>
        <div data-bind="dxSlider: { min: 0, max: 100, value: age }">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Gender</div>
        <div class=dx-field-value" data-bind="dxSelectBox: { dataSource: genders, value: gender }">
        </div>
    </div>
    <div class="dx-field">
        <div class=dx-field-label>Full Name</div>
        <div class=dx-field-value">
            <span data-bind="text: firstName"></span> <span data-bind="text: lastName"></span>
        </div>
    </div>
</div>
firstName = ko.observable("John");
lastName = ko.observable("Smith");
age = ko.observable(31);
gender = ko.observable("Male");
genders = ["Male", "Female"];

dx-icon-IconName

Use this class to add a custom icon to the style sheet used in your application.

The name of this class must include the real name of the icon. For instance, the "myicon" icon must be defined by the "dx-icon-myicon" class.

CSS
.dx-icon-myicon
{
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAQAAAACj/
  OVAAAARElEQVRYw+3WKQ4AIAADMPb/R4PHIDgTOr/ULUstZxPgfbAvBAgEAoFAIPAhcPebChAIHIKmDQgEAoFA4E/
  g7JcCrk4DW5xoAVzaKL0AAAAASUVORK5CYII=) 0 0 no-repeat;
}

As you can see, the icon is added in the Base64 type in the code above. We recommend that you also use this type to reduce the number of requests and the amount of data transferred.

The icons that are added to the stylesheet via this class can be used for PhoneJS widgets like predefined icons from the built-in icon library.

CSS
<div class="button" data-bind="dxButton: { icon: 'myicon', text: 'Click me' }"></div>
Show Example:
jQuery
<div class="button" data-bind="dxButton: { text: 'Click me', icon: 'myicon' }"></div>
body{
  text-align: center;
}
.button{
  margin: 20px;
}

.dx-theme-android .dx-icon-myicon
{
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAQAAAACj/OVAAAARElEQVRYw+3WKQ4AIAADMPb/R4PHIDgTOr/ULUstZxPgfbAvBAgEAoFAIPAhcPebChAIHIKmDQgEAoFA4E/g7JcCrk4DW5xoAVzaKL0AAAAASUVORK5CYII=) 0 0 no-repeat;
}

.dx-theme-ios.dx-version-major-5 .dx-icon-myicon, .dx-theme-ios.dx-version-major-6 .dx-icon-myicon
{
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAQAAAACj/OVAAAAbElEQVRYw+3XMQoAIQxE0YzswffmsRK2kbFZg/itVNBHRHBUxt7WNnvxjI5WV7xmPGlZVaHSVJhuwhyNqisEBAQEBAQE/GSaWTaRe/AXM83Yvy7TxN8BVdxSQED+FoCAgICAgIA3ZBqO9FiwA9kyEOwz5x38AAAAAElFTkSuQmCC) 0 0 no-repeat;
}

.dx-theme-ios.dx-version-major-7 .dx-icon-myicon
{
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEwAAABMCAQAAABtnpmgAAAAZUlEQVRo3u3SsQkAIAwEQDOw0ziwFhZiY6OixX0VCDwXSNT0ZwIMDAwMDAwMDAwMDAzsJKyMsVfFvM9gYGBgYGBgYCvG1h05wL6BeX4wMDAwMDCw27BbAQMDAwMDAwMDAwMDe5IGFJGKAcyLcs4AAAAASUVORK5CYII=) 0 0 no-repeat;
}

.dx-theme-win8 .dx-icon-myicon
{
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAQAAAACj/OVAAAARElEQVRYw+3WKQ4AIAADMPb/R4PHIDgTOr/ULUstZxPgfbAvBAgEAoFAIPAhcPebChAIHIKmDQgEAoFA4E/g7JcCrk4DW5xoAVzaKL0AAAAASUVORK5CYII=) 0 0 no-repeat;
}

.dx-theme-tizen .dx-icon-myicon
{
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAQAAAACj/OVAAAAdUlEQVRYw+3WsQ2AIBCFYW8OGMjWKZiJKWgdSOc4G6sjyjWciflfQyBcvgryRJfYCOA0UB4uJHtQzb68A+e9KiAgICAgICBgAJjr3PJ0FEBAwBEom28wreZh7745bfylgICAgICAgN+BXWz3ac5OY8Go/B+8AFPfwwEKIgpIAAAAAElFTkSuQmCC) 0 0 no-repeat;
}

.dx-theme-generic .dx-icon-myicon
{
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAAcElEQVRo3u3XIQ6AMAxA0fbQUzM1Uzv0sFgEYcD7uknzTJPmWiu+XAICAgICAgICAgK+FVhjXhk/L8uIiOoNEBAQEBAQEBAQEPA3wBrzsR+rektAQEcGEBAQEBAQEBAQEPB24O4BAgICAgICAgJu2wG3bCOgMHkN8wAAAABJRU5ErkJggg==) 0 0 no-repeat;
}

dx-state-active

This class is applied to a widget or widget element when it is touched or clicked.

You can specify a custom style for this class to override the default style.

Show Example:
jQuery
<div class="tileView" data-bind="dxTileView: {
    dataSource: tileViewDataSource,
    itemMargin: 20,
    baseItemHeight: 130,
    baseItemWidth: 180
}">
    <div class="tile" data-options="dxTemplate:{name:'item'}">
    <p style="font-size:larger;"><b data-bind="text: name"></b></p>
    <img style="margin:5px;" data-bind="attr: { src: getImagePath(name) }" />
        <p>Capital: <i data-bind="text: capital"></i></p>
    </div>
</div>
//An object passed to the dataSource configuration option of the tile view
tileViewDataSource = new DevExpress.data.DataSource("/Content/data/states.txt");

//Generates the path to the required image file
getImagePath = function (name) {
    return "/Content/images/doc/13_2/PhoneJS/flags/" + name.replace(" ", "") + ".gif";
};
.dx-state-active{
  border: solid 4px red;
}
.tile {
  border-radius: .5em;
  text-align: center;
  color: white;
  background: gray;
}

dx-state-disabled

Set this class to a widget element to disable the widget.

Show Example:
jQuery
<div class="dx-fieldset">
    <div class="dx-field" style="text-align:center;">
        Apply <b>"dx-state-disabled"</b> class to the button element<br />
        <div data-bind="dxCheckBox: { checked: applyClass }"></div>
    </div>
</div>
<div id="myButton" data-bind="dxButton: { text:'Click me' }">
</div>
applyClass = ko.observable(false);
applyClass.subscribe(function (newValue) {
    if (newValue)
        $("#myButton").addClass("dx-state-disabled");
    else
        $("#myButton").removeClass("dx-state-disabled");
});
body{
    text-align:center;
}
#myButton{
    margin: 10px;
}

dx-state-invisible

Set this class to a widget element to hide the widget.

Show Example:
jQuery
<div class="dx-fieldset">
    <div class="dx-field" style="text-align:center;">
        Apply <b>"dx-state-invisible"</b> class to the button element<br />
        <div data-bind="dxCheckBox: { checked: applyClass }"></div>
    </div>
</div>
<div id="myButton" data-bind="dxButton: { text: 'Click me' }">
</div>
applyClass = ko.observable(false);
applyClass.subscribe(function (newValue) {
    if (newValue)
        $("#myButton").addClass("dx-state-invisible");
    else
        $("#myButton").removeClass("dx-state-invisible");
});
body{
    text-align:center;
}
#myButton{
    margin: 10px;
}

dx-translate-disabled

Set this class to a widget element to disable translating the widget text to a local language.

dx-user-select

Set this class to a <span> element to enable a user to select the text contained in this element.

HTML
<p>You can select <span class="dx-user-select">this text</span>.</p>