Girl' Card Credit 'Flower Card Business CH00009153 Wallet Holder Azeeda BFwpqY
An array of grid columns.
By default, a column is created for each field of a data source object, but in most cases, it is redundant. To specify a set of columns to be created in a grid, assign an array specifying these columns to the columns option. Each grid column is represented in this array by an object containing column settings or by a data source field that this column is bound to. Detailed information on specifying grid columns is given in the Columns Overview article.
Column options define the behavior and appearance of a grid column. One of the other capabilities allows you to control the sorting of column values using the allowSorting and sortOrder options, apply a filter to grid records using the allowFiltering and filterOperations options, and group grid records using the allowGrouping and groupIndex options. In addition, you can change the visibility and width of a column using corresponding options.
To get or set an option or several options for a column at runtime, use the columnOption method with the required arguments.
See Also
alignment
Aligns the content of the column.
The default alignment of the content depends on the type of data.
dataType | alignment |
---|---|
'number' | 'right' |
'boolean' | 'center' |
'string' | 'left' |
'date' | 'left' |
'datetime' | 'left' |
Use the HorizontalAlignment
enum to specify this option when the widget is used as an ASP.NET MVC Control. This enum accepts the following values: Left
, Center
, and Right
.
allowEditing
Specifies whether a user can edit values in the column at runtime. By default, inherits the value of the editing.allowUpdating option.
See Also
allowFiltering
Specifies whether data can be filtered by this column. Applies only if filterRow.visible is true.
See Also
- columns[].allowHeaderFiltering
allowFixing
Specifies whether a user can fix the column at runtime. Applies only if columnFixing.enabled is true.
See Also
- columnFixing
- columns[].fixed
allowGrouping
Specifies whether the user can group data by values of this column. Applies only when grouping is enabled.
When grouping is enabled in the widget, the user can group data by values of any column. To prohibit a particular column from being used for grouping, set the allowGrouping option of this column to false.
See Also
allowHeaderFiltering
Specifies whether the header filter can be used to filter data by this column. Applies only if headerFilter.visible is true. By default, inherits the value of the allowFiltering option.
allowHiding
Specifies whether a user can hide the column using the column chooser at runtime. Applies only if columnChooser.enabled is true.
See Also
allowReordering
Specifies whether this column can be used in column reordering at runtime. Applies only if allowColumnReordering is true.
To Stylish Your Cry Coin Crowd From Money Out Purse Carry Hamerson Baby Pouch By Custom The Grab Goods amp; Accessories The Unique amp;Stand Handbag Neoprene EXqOOAnw0 allowResizing
Specifies whether a user can resize the column at runtime. Applies only if allowColumnResizing is true.
See Also
- columns[].width
- columnAutoWidth
- columnMinWidth
allowSearch
Specifies whether this column can be searched. Applies only if searchPanel.visible is true. Inherits the value of the allowFiltering option by default.
allowSorting
Specifies whether a user can sort rows by this column at runtime. Applies only if sorting.mode differs from "none".
autoExpandGroup
Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column.
calculateCellValue
Calculates custom values for column cells.
The data of the row to which the cell belongs.
A cell's custom value.
Column cells contain values from the data field by default, but you can populate them with custom values instead. For this, declare the calculateCellValue function that is called each time a new row is rendered.
Certain features are disabled in a column with calculated values by default. The following list specifies these features and how you can enable them:
Feature | Action that enables it |
---|---|
Editing | Implement the setCellValue function. |
Sorting | Set the allowSorting option to true. |
Grouping | Set the allowGrouping option to true. |
Filtering | Set the allowFiltering option to true. |
Searching | Set the allowSearch option to true. |
Call the this.defaultCalculateCellValue(rowData) function and return its result to invoke the default behavior.
jQuery
Angular
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- calculateCellValue (rowData) {
- // ...
- let column = this as any;
- return column.defaultCalculateCellValue(rowData);
- }
- }
- @NgModule({
- imports: 'Flower Card Wallet Azeeda Girl' Holder Credit Card CH00009153 Business [
- // ...
- DxDataGridModule
- ],
- // ...
- })
... > -
[calculateCellValue]="calculateCellValue" ... >
this
keyword refers to the column's configuration.
See Also
- columns[].calculateDisplayValue
calculateDisplayValue
Calculates custom display values for column cells. Used when display values should differ from values for editing.
The data of the row to which the cell belongs.
The value for the cell to display.
This option accepts the name of the data source field that provides display values...
jQuery
Angular
... > -
- dataField="countryID"
- calculateDisplayValue="country">
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- // ...
- }
- @NgModule({
- imports: Holder Azeeda Card Girl' CH00009153 Business 'Flower Wallet Credit Card [
- // ...
- DxDataGridModule
- ],
- // ...
- })
ASP.NET MVC Controls
- @(Html.DevExtreme().DataGrid()
- .Columns(columns => columns.Add()
- .DataField("CountryID")
- .CalculateDisplayValue("Country")
- )
- )
- @(Html.DevExtreme().DataGrid() _
- .Columns(Sub(columns)
- columns.Add() _
- .DataField("CountryID") _
- .CalculateDisplayValue("Country")
- End Sub)
- )
... or a function that combines display values.
jQuery
Angular
... Canvas Tote Seven Seven Guitar Player Bag String Eddany Guitar String Eddany chick OqnSfwU> -
- dataField="countryID"
- [calculateDisplayValue]="getCountryWithCapital">
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- getCountryWithCapital(rowData) {
- return rowData.capital + " (" + rowData.country + ")";
- }
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
ASP.NET MVC Controls
- @(Html.DevExtreme().DataGrid()
- .Columns(columns => columns.Add()
- .DataField("CountryID")
- .CalculateDisplayValue(new JS("getCountryWithCapital"))
- )
- )
- function getCountryWithCapital(rowData) {
- return rowData.capital + " (" + rowData.country + ")";
- }
- script>
- @(Html.DevExtreme().DataGrid() _
- .Columns(Sub(columns)
- columns.Add() _
- .DataField("CountryID") _
- .CalculateDisplayValue(New JS("getCountryWithCapital"))
- End Sub)
- )
- <script>
- function getCountryWithCapital(rowData) {
- return rowData.capital + " (" + rowData.country + ")";
- }
- script>
this
keyword refers to the column's configuration.
Do not use this option to format text in cells. Use customizeText for this.
See Also
- columns[].calculateCellValue
calculateFilterExpression
Specifies the column's custom filtering rules.
A filter expression.
This function must return a filter expression. The simplest filter expression has the following format:
- [selector, selectedFilterOperation, filterValue]
- selector
A data source field or a function providing actual column values. Pass this.calculateCellValue if your column contains calculated values. selectedFilterOperation
A comparison operator. One of the following: "=", "<>", ">", ">=", "<", "<=", "between", "startswith", "endswith", "contains", "notcontains".NOTEFor the "between" operator, the returned filter expression has a slightly different format:[[selector, ">=", startValue], "and", [selector, "<=", endValue]]
.filterValue
A user input value. Values the selector provides are compared to this value.
The following code shows the default calculateFilterExpression function implementation. You can change it as required.
jQuery
Angular
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- calculateFilterExpression (filterValue, selectedFilterOperation) {
- // Implementation for the "between" comparison operator
- if (selectedFilterOperation === "between" && Array.isArray(filterValue)) {
- var filterExpression = [
- [this.dataField, ">=", filterValue[0]],
- "and",
- [this.dataField, "<=", filterValue[1]]
- ];
- Cities Tirol Idakoos Hashtag Bag Canvas Tote Idakoos Hashtag cTqSaSreturn filterExpression;
- }
- // Invokes the default filtering behavior
- return this.defaultCalculateFilterExpression.apply(this, arguments);
- }
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
... > -
[calculateFilterExpression]="calculateFilterExpression" ... >
In the previous code, the defaultCalculateFilterExpression function invokes the default behavior. You can omit the function call if you do not need it.
this
keyword refers to the column's configuration.
calculateGroupValue
Specifies a field name or a function that returns a field name or a value to be used for grouping column cells.
The current row's data.
The calculated value to be used for grouping.
By default, grouping is conducted using the exact values that the grouping column contains. However, in some cases, this approach may be giving poor results, e.g., when a user tries to group records by a column that contains dates. In such cases, it may be preferable to use calculated values in grouping. For this purpose, assign a function to the calculateGroupValue option. This function must return the calculated value for grouping.
this
keyword refers to the column's configuration.
calculateSortValue
Calculates custom values to be used in sorting.
The data of the row to which the cell belongs.
The value to be used in sorting.
This option accepts the name of the data source field that provides values to be used in sorting...
jQuery
Angular
... > -
- dataField="Position"
- calculateSortValue="isOnVacation">
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- // ...
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
... or a function that returns such a value.
'Flower Card Holder Business Wallet CH00009153 Credit Azeeda Girl' Card jQuery
Angular
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- customSortingFunction (rowData) {
- if (rowData.Position == "CEO")
- return this.sortOrder == 'asc' ? "aaa" : "zzz"; // CEOs are always displayed at the top
- else
- return rowData.Position; // Others are sorted as usual
- }
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
... > -
- dataField="Position"
- sortOrder="asc"
- [calculateSortValue]="customSortingFunction">
this
keyword refers to the column's configuration.
caption
Specifies a caption for the column.
Use this option to display a descriptive or friendly name for the column. If this option is not set, the caption will be generated from the name of the dataField.
cellTemplate
Specifies a custom template for column cells.
The current cell's container. It is an HTML Element or a jQuery Element when you use jQuery.
The cell's properties.
The cellInfo object has the following fields:
- data: Object
The data of the row to which the cell belongs. - component: Object
The widget's instance. - value: Any
The value of the cell as it is specified in the data source. - displayValue: Any
The display value of the cell. Differs from the value field only when the column uses lookup or calculateDisplayValue. - text: String
displayValue after applying 'Rose' Azeeda Card Holder Card Business Card Business 'Rose' CH00005452 Wallet Credit Azeeda f6qawp6IO and customizeText. - columnIndex: Number
The index of the column to which the cell belongs. For more information on how this index is calculated, refer to the Column and Row Indexes topic. - rowIndex: Number
The index of the row to which the cell belongs. Begins with 0 on each page. Group rows are included. For details on row indexes, see the Column and Row Indexes topic. - column: Object
The settings of the column to which the cell belongs. - rowType: String
The type of the row to which the cell belongs. Equals "data" for ordinary rows or "group"Box Clutch Womens Bridesmaids White Damara Womens Damara Luxury Sequins xqBXZT0 for group rows.
View Function Template Demo View Underscore Template Demo
See Also
columns
Columns banded by the current column.
Unlike normal columns, band columns do not hold data. Instead, they collect two or more columns under one column header. To set up this layout, declare the band column using a hierarchical structure. For this, assign the nested columns to the columns field of the band column. For example, the following code declares the "Address" band column and nests three columns within it.
jQuery
Angular
... > -
caption="Address"> -
dataField="City"> -
dataField="Street"> -
dataField="Apartment">
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- // ...
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
A nested column has almost every option a regular column has. These options are described in the columns section of the Reference.
For example, the following code specifies the width and sortOrder options of the "Street" column nested within the fixed "Address" band column.
jQuery
Angular
... > -
- caption="Address"
- [fixed]="true"
- fixedPosition="right">
-
dataField="City"> -
dataField="Street" [width]="100" sortOrder="asc"> -
dataField="Apartment">
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- // ...
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
Band columns support hierarchies of any nesting level. It means that the following structure is acceptable.
jQuery
Angular
... > -
caption="A"> -
dataField="A1"> -
dataField="A2"> -
caption="A3"> -
dataField="A31"> -
dataField="A32"> -
caption="A33"> -
dataField="A331"> -
dataField="A332"> -
dataField="A333"> -
caption="B"> - ...
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export classWallet Credit Card Holder 'Flower Girl' CH00009153 Business Card Azeeda AppComponent {
- // ...
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
Band columns have the isBand flag. Banded columns have the ownerBand option set. Use these options to distinguish band and banded columns from regular ones in code.
See Also
customizeText
Customizes the text displayed in column cells.
Information on the current cell.
Travel Brown Boston Vintage Disney Weekender Pattern Bag ililily Mickey Mouse Duffle f0wqa8vt
The cell's raw value.
The fomatted value converted to a string.
The UI element where the customizeText function was called: "row", "filterRow", "headerFilter", "search", "filterPanel", or "filterBuilder".
Indicates how header filter values were combined into groups. Available if target is "headerFilter".
For possible values, see the description of the headerFilter.groupInterval option.
The text for the cell to display.
The customizeText function may be called when data displayed in the column matches the search condition to properly highlight the matching text.
this
keyword refers to the column's configuration.
See Also
dataField
Binds the column to a field of the dataSource.
The columns array can contain only the names of data source fields, which is sufficient if you do not need to specify any other column options. But if you do, then this array should contain objects that configure columns. To bind the columns to data source fields, use the dataField option. Note that you can combine both declarations in a single array as shown in the following code.
jQuery
Angular
... > -
dataField="CustomerID"> -
Holder 'Flower Card Wallet Azeeda Credit Girl' CH00009153 Card Business dataField="EmployeeID" [width]="200"> -
dataField="OrderDate"> -
dataField="Freight" format="fixedPoint"> -
dataField="ShipName"> -
dataField="ShipCity">
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- // ...
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
See Also
dataType
Casts column values to a specific data type.
If your data source stores, for example, numbers as strings, specify the proper data type using this option.
"yyyy/MM/dd"
,
"yyyy/MM/dd HH:mm:ss"
,
"yyyy-MM-ddTHH:mm:ssx"
or
"yyyy-MM-ddTHH:mm:ss"
.
Use the GridColumnDataType
enum to specify this option when the widget is used as an ASP.NET MVC Control. This enum accepts the following values: String
, Number
, Date
, DateTime
, Boolean
, and Object
.
See Also
editCellTemplate
Specifies a custom template for column cells in the editing state.
The current cell's container. It is an HTML Element or a jQuery Element when you use jQuery.
The cell's properties.
The cellInfo object has the following fields:
setValue(newValue, newText): Method
A method that you should call to change the cell value and, optionally, the displayed value after the editor's value is changed.NOTEIn batch editing mode, check that the value changed before calling this method to ensure correct cell highlighting.data: Object
The data of the row the cell belongs to.- component: Object
The widget's instance. - value: Any
The cell value as it is specified in the data source. - displayValue: Any
The displayed cell value. Differs from the value field only when the column uses lookup or calculateDisplayValue. - text: String
displayValue after applying 'Rose' Azeeda Card Holder Card Business Card Business 'Rose' CH00005452 Wallet Credit Azeeda f6qawp6IO and customizeText. - columnIndex: Number
The index of the column the cell belongs to. Refer to the Column and Row Indexes topic for more information on how this index is calculated. - rowIndex: Number
The index of the row the cell belongs to. Begins with 0 on each page. Group rows are included. Refer to the Column and Row Indexes topic for more information on row indexes. - column: Object
The settings of the column the cell belong to. - rowType: String
The type of the row the cell belongs to. Equals "data" for ordinary rows or "group" for group rows.
See Also
editorOptions
Specifies options for the underlain editor.
Depending on the dataType, the column offers a user different widgets for editing and filtering (using the filter row): TextBox, DateBox, Lookup, etc. In the editorOptions object, you can specify options for the widget.
Do not specify the onValueChanged option in this object. If you need to add custom logic to the standard value change handler, override the handler in the onEditorPreparing function in the following manner.
jQuery
Angular
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- onEditorPreparing (e) {
- if (e.dataField == "requiredDataField") {
- let standardHandler = e.editorOptions.onValueChanged;
- e.editorOptions.onValueChanged = function (e) { // Overriding the standard handler
- // ...
- // Custom commands go here
- // ...
- standardHandler(e); // Calling the standard handler to save the edited value
- }
- }
- }
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
... - (onEditorPreparing)="onEditorPreparing($event)">
encodeHtml
Specifies whether HTML tags are displayed as plain text or applied to the values of the column.
When true, HTML tags are displayed as plain text; when false, they are applied to the values of the column.
falseText
In a boolean column, replaces all false items with a specified text. Applies only if showEditorAlways option is false.
See Also
- columns[].trueText
filterOperations
Specifies a set of available filter operations. Applies only if filterRow.visible and allowFiltering are true.
The following table lists available filters by data types. The same filters are assigned to columns of a specific data type by default.
dataType | filterOperations |
---|---|
"string" | [ "contains", "notcontains", "startswith", "endswith", "=", "<>" ] |
"numeric" | [ "=", "<>", "<", ">", "<=", ">=", "between" ] |
"date" | [ "=", "<>", "<", ">", "<=", ">=", "between" ] |
The filterOperations option can also accept an empty array. In this case, the selected filter operation is "=" for all data types, and a user cannot change it.
Use the FilterOperations
enum to specify this option when the widget is used as an ASP.NET MVC Control. This enum accepts the following values: Equal
, NotEqual
, LessThan
, LessThanOrEqual
, GreaterThan
, GreaterThanOrEqual
, NotContains
, Contains
, StartsWith
, EndsWith
, and Between
.
See Also
filterType
Specifies whether a user changes the current filter by including (selecting) or excluding (clearing the selection of) values. Applies only if headerFilter.visible and allowHeaderFiltering are true.
This option accepts the following values.
- include
Values in the header filter are unselected initially, and the user changes the filter by selecting, that is, including the values. - exclude
All values in the header filter are selected initially, and the user changes the filter by clearing the selection of certain values, that is, by excluding them.
Use the FilterType
enum to specify this option when the widget is used as an ASP.NET MVC Control. This enum accepts the following values: Include
and Exclude
.
See Also
- Filtering API
- columns[].filterValues
filterValue
Specifies a filter value for the column.
You can specify a filter value for the column using this option as if a user set this value with the filter row. This value is applied using the selectedFilterOperation.
filterValues
Specifies filter values for the column's header filter.
You can specify filter values for the column using this option as if a user set them with the header filter.
See Also
fixedPosition
Specifies the widget's edge to which the column is fixed. Applies only if columns[].fixed is true.
Use the HorizontalEdge
enum to specify this option when the widget is used as an ASP.NET MVC Control. This enum accepts the following values: Left
and Right
.
See Also
Women's Travelling Waist Bag Zipper 5 Printing Bag Bag Bum Fanny 3D Bag Packs rUqp6r format
Formats a value before it is displayed in a column cell.
This option also controls the user input in cells that use the DateBox widget for editing. For cells that use other widgets, you can specify the editorOptions.format option.
jQuery
Angular
- [dataSource]="orders">
-
[allowUpdating]="true"> -
- dataField="SaleAmount"
- format="currency"
- [editorOptions]="{ format: '$ #,##0.##' }">
See Also
formItem
Configures the form item produced by this column in the editing state. Used only if editing.mode is "form" or "popup".
The SimpleItem section describes the options that you can specify in this object.
See Also
- editing.form
groupCellTemplate
Specifies a custom template for group cells.
The current cell's container. It is an HTML Element or a jQuery Element when you use jQuery.
The current cell's properties.
The cellInfo object has the following fields:
data
Contains a data object that represents data items matching a grouping key. For example, if you group grid records by country, the following object can be obtained from the data field.JavaScript- {
- key: 'Spain', // The name of a country
- items: [ // Data source objects corresponding to the key
- { ... },Business CH00009153 Card Girl' Credit Azeeda Wallet Holder 'Flower Card
- { ... },
- // ...
- ]
- }
- component
Contains the DataGrid instance. - value
Contains the value of the current group cell as it is specified in a data source. - text
Contains the value of the current group cell in a string format. Use this field to get a value with applied 'Rose' Azeeda Card Holder Card Business Card Business 'Rose' CH00005452 Wallet Credit Azeeda f6qawp6IO. - displayValue
Contains the value displayed by the current group cell. Differs from the value field only when the column to which the current cell belongs uses lookup. - columnIndex
Contains the index of the column to which the current group cell belongs. For more information on how this index is calculated, refer to the Column and Row Indexes topic. - rowIndex
Contains the index of the row that the current group cell occupies. For further information about row indexes, see the Column and Row Indexes topic. - column
Contains the settings of the column to which the current group cell belongs. - summaryItems
An array of group summary items that are defined to be displayed in a group row. The array objects have the structure of the group summary items with an addition of the value (the summary item value) and columnCaption (usually used to present a summary value) fields. - groupContinuesMessage
If the current group continues on the next page, this field contains a corresponding message. The value of this field equals the value of the grouping.groupContinuesMessage property. If the current group does not continue on the next page, this field equals undefined. - groupContinuedMessage
If the current group is continued from the previous page, this field contains a corresponding message. The value of this field equals the value of the grouping.groupContinuedMessage property. If the current group is not continued from the previous page, this field equals undefined.
See Also
groupIndex
Specifies the index of a column when grid records are grouped by the values of this column.
At runtime, the user can group grid records using the context menu or the group panel. But there may be cases when grid records must be grouped initially. To do this, assign an integer value to the groupIndex option of those columns that should be used for grouping grid records. For example, consider the following data source.
- var dataSource = [
- { FirstName: 'John', LastName: 'Doe', Title: 'Sales Manager' },
- { FirstName: 'Michael', LastName: 'King', Title: 'Sales Representative' },
- // ...
- ];
To group these records first by the "LastName" field and then by the "FirstName" field, use the following code.
jQuery
Angular
... > -
dataField="FirstName" [groupIndex]="1"> -
dataField="LastName" [groupIndex]'Flower Business Wallet CH00009153 Card Credit Card Holder Girl' Azeeda ="0">
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- // ...
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
See Also
headerCellTemplate
Specifies a custom template for column headers.
The current header's container. It is an HTML Element or a jQuery Element when you use jQuery.
The header's properties.
The headerInfo object has the following fields:
- component: Object
The widget's instance. - columnIndex: Number
The index of the column to which the header belongs. For details on how this index is calculated, refer to the Column and Row Indexes topic. - column: Object
The settings of the column to which the header belongs.
See Also
headerFilter
Specifies data settings for the header filter.
See Also
hidingPriority
Specifies the order in which columns are hidden when the widget adapts to the screen or container size. Ignored if allowColumnResizing is true and columnResizingMode is "widget".
The hidingPriority is a unique positive integer that ascends from right to left beginning with 0 by default. Columns with low hidingPriority are hidden first.
See Also
isBand
Specifies whether the column bands other columns or not.
Unlike normal columns, band columns do not hold data. Instead, they collect two or more columns under one column header. In most cases, to set up this layout, you can declare the band column using a hierarchical structure. For example, the following code bands three columns under the "Address" header.
jQuery
Angular
... > -
caption="Address"> -
dataField="City"> -
dataField="Street"> -
dataField="Apartment">
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- // ...
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
If you use the customizeColumns option to configure columns, the hierarchical structure cannot be implemented. To band columns in this case, use the isBand and ownerBand options.
jQuery
Angular
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- customizeColumns (columns) {
- columns.push({ // Pushes the "Address" band column into the "columns" array
- caption: "Address",
- isBand: true
- });
- let addressFields = ['City', 'Street', 'Apartment'];
- for (let i = 0; i < columns.length - 1; i++) {
- if (addressFields.indexOf(columns[i].dataField) > -1) // If the column belongs to "Address",
- columns[i].ownerBand = columns.length - 1; // assigns "Address" as the owner band column
- }
- }
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
... - [customizeColumns]="customizeColumns">
Band columns can have the following properties only:
- alignment
- allowHiding
- allowReordering
- caption
- columns
- cssClass
- fixed
- fixedPosition
- headerCellTemplate
- name
- ownerBand
- showInColumnChooser
- visible
- visibleIndex
See Also
lookup
Specifies options of a lookup column.
A lookup column restricts the set of values that can be chosen when a user edits or filters the column. In a lookup column, each cell is a drop-down menu. You can use a lookup column when you need to substitute displayed values with required values. For example, consider that you have two arrays of objects: drivers
and buses
.
- var drivers = [
- { driverID: 1, firstName: 'John', lastName: 'Smith', busID: 2 },
- { driverID: 2, firstName: 'Lizzy', lastName: 'Cook', busID: 1 },
- { driverID: 3, firstName: 'Brian', lastName: 'Hawkins', busID: 3 }
- ];
- var buses = [
- { busID: 1, plates: '123456' },
- { busID: 2, plates: 'AB-1234' },
- { busID: 3, plates: 'CD-9876' }
- ];
All drivers
have the busID
field, which refers to a bus. If drivers
is the main dataSource, the Bus ID column displays bus IDs, which provides little information to a user. It will be more useful to display bus license plates instead of IDs. For this, the buses
array must be set as a lookup dataSource for the Bus ID column. Then, the names of data fields must be assigned to the Student Bag Girls Fashion Children Shoulder Backpacks Brown Bag EUzeo Sequins School Travel xXAfwnXq and displayExpr options. Values from the valueExpr data field will be replaced with values from the displayExpr data field.
jQuery
Angular
[dataSource]="drivers"> -
dataField="busID"> -
- [dataSource]="buses"
- valueExpr="busID"
- displayExpr="plates">
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- drivers = [
- { driverID: 1, firstName: 'John', lastName: 'Smith', busID: 2 },
- { driverID: 2, firstName: 'Lizzy', lastName: 'Cook', busID: 1 },
- { driverID: 3, firstName: 'Brian', lastName: 'Hawkins', busID: 3 }
- ];
- buses = [
- { busID: 1, plates: '123456' },
- { busID: 2, plates: 'AB-1234' },
- { busID: 3, plates: 'CD-9876' }
- ];
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
With this code, the Bus ID column contains license plates instead of IDs. Moreover, the user can choose a plate number from the drop-down menu when editing cells or applying a filter to this column.
See Also
name
Specifies the identifier of the column.
Set this option if you need to refer to the column in your code afterwards, for example, when changing a column option.
ownerBand
Specifies the band column that owns the current column. Accepts the index of the band column in the columns array.
Main article: isBand
precision
Use the 'Rose' Azeeda Card Holder Card Business Card Business 'Rose' CH00005452 Wallet Credit Azeeda f6qawp6IO.precision option instead.
Specifies a precision for formatted values displayed in a column.
selectedFilterOperation
Specifies the selected filter operation for the column.
By default, the selected filter operation depends on the data type of the column as follows.
dataType | Default filter operation |
---|---|
"string" | "contains" |
"number" | "=" |
"date" | "=" |
Use the FilterOperations
enum to specify this option when the widget is used as an ASP.NET MVC Control. This enum accepts the following values: Equal
, NotEqual
, LessThan
, LessThanOrEqual
, GreaterThan
, GreaterThanOrEqual
, NotContains
, Contains
, StartsWith
, EndsWith
, and Between
.
See Also
setCellValue
Specifies a function to be invoked after the user has edited a cell value, but before it will be saved in the data source.
The data object where new data should be set.
The input value.
A read-only parameter providing access to the current row data.
Using this function, you can process user input before it is saved to the data source. This function accepts the newData, value and currentRowData parameters. value is the user input that you should assign to one of the fields of the newData. Initially, newData is an empty object. Fill it with fields whose values should be saved in the data object of the current row. currentRowData is a read-only parameter used to access the current row data.
jQuery
Angular
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- setCellValue (newData, value, currentRowData) {
- newData.Count = value;
- newData.TotalPrice = currentRowData.Price * value;
- }
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
... > -
dataField="Price"> -
- dataField="Count"
- dataType="number"
- [setCellValue]="setCellValue">
-
dataField="TotalPrice">
To invoke the default behavior, call the this.defaultSetCellValue(newData, value) function.
this
keyword refers to the column's configuration.
showEditorAlways
Specifies whether the column displays its values using editors.
A column cell has normal and editing states. In a normal state, the cell value is text. In the editing state, the cell contains an editor that indicates the cell value and allows a user to edit it. In certain cases, a viewer reads the cell value easier if it is indicated by an editor even in the normal state. For example, boolean values are more comprehensible when they are indicated by check boxes. To display editors in cells permanently, set the showEditorAlways option to true.
This option has the following peculiarities.
- The default value of this option depends on the column's dataType. For boolean columns, it is true; for columns of other types - false.
- If you use templates, setting this option to true means that the column will always use editCellTemplate instead of cellTemplate.
See Also
- columns[].editorOptions
showInColumnChooser
Specifies whether the column chooser can contain the column header.
See Also
- columns[].visible
Messenger Tote Denim Abuyall Cute Handbag Pub Travel A Crossbody Style Jean Denim Sweet Bag Bag Diamonds Women Shoulder Hobo qwACwxgOF showWhenGrouped
Specifies whether or not to display the column when grid records are grouped by it.
Displaying a grouping column may be useful if you calculate its grouping values. Consider that you need to group records by a column that contains dates. Grouping by full dates seems inconvenient. It would be smarter to group by months or years instead. For this purpose, you calculate grouping values within the calculateGroupValue function and leave the grouping column visible by setting the showWhenGrouped option to true so that the user can view the full dates.
sortIndex
Specifies the index according to which columns participate in sorting.
This option accepts an integer specifying the index of the column in a collection of columns with applied sorting. For example, consider the following data source that can provide data for three columns.
- var dataSource = [
- { firstName: 'John', lastName: 'Doe', title: 'Sales Manager' },
- { firstName: 'Michael', lastName: 'King', title: 'Sales Representative' },
- // ...
- ];
To sort data first by the "Last Name" and then by the "First Name" column, use the following code. Note that the sortOrder option should also be specified.
jQuery
Angular
... > -
dataField="firstName" [sortIndex]="1" sortOrder="asc"> -
dataField="lastName" [sortIndex]="0" sortOrder="asc">
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- // ...
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
You can set the sortIndex option at design time to specify initial sorting, or change this option using the columnOption method to sort at runtime.
sortingMethod
Specifies a custom comparison function for sorting. Applies only when sorting is performed on the client.
A value to be compared.
A value to be compared.
Specifies whether value1 goes before value2.
This function accepts two cell values and should return a number indicating their sort order:
- Less than zero
value1 goes before value2. - Zero
value1 and value2 remain unchanged relative to each other. - Greater than zero
value1 goes after value2.
The string comparison is culture-insensitive by default. Use the following code to make it culture-sensitive:
jQuery
Angular
- import { DxDataGridModule } from 'devextreme-angular';
- // ...
- export class AppComponent {
- sortStringsConsideringCulture (value1, value2) {
- // Handling null values
- if(!value1 && value2) return -1;
- if(!value1 && !value2) return 0;
- if(value1 && !value2) return 1;
- // Determines whether two strings are equivalent in the current locale
- return value1.localeCompare(value2);
- }
- }
- @NgModule({
- imports: [
- // ...
- DxDataGridModule
- ],
- // ...
- })
... > -
- dataField="fieldName"
- [sortingMethod]="sortStringsConsideringCulture">
this
keyword refers to the column's configuration.
sortOrder
Specifies the sort order of column values.
By default, rows are sorted according to the data source. Set the sortOrder option to sort rows in a required order. If you need to sort by multiple columns, specify the sortIndex option as well, or otherwise, each sorted column will get a sort index according to the position in the columns array.
Use the SortOrder
enum to specify this option when the widget is used as an ASP.NET MVC Control. This enum accepts the following values: Asc
and Desc
.
See Also
trueText
In a boolean column, replaces all true items with a specified text. Applies only if showEditorAlways option is false.
See Also
- columns[].falseText
validationRules
Specifies validation rules to be checked on updating cell values.
Array<RequiredRule | NumericRule | RangeRule | StringLengthRule | CustomRule | CompareRule | PatternRule | EmailRule>
visibleIndex
Specifies the position of the column regarding other columns in the resulting widget.
See Also
- Reordering: Data Columns | Command Columns
width
Specifies the column's width in pixels or as a percentage. Ignored if it is less than minWidth.
The option supports the following types of values:
- Number
The column's width in pixels. String
A CSS-accepted column width measurement (for example, "55px", "80%" and "auto").NOTEFixed columns ignore widths specified as a percentage.