-
Data Grid
- Overview
-
Data Binding
-
Paging and Scrolling
-
Editing
-
Grouping
-
Filtering and Sorting
- Focused Row
-
Row Drag & Drop
-
Selection
-
Columns
- State Persistence
-
Appearance
-
Templates
-
Data Summaries
-
Master-Detail
-
Export to PDF
-
Export to Excel
-
Adaptability
- Keyboard Navigation
-
Pivot Grid
- Overview
-
Data Binding
-
Field Chooser
-
Features
-
Export to Excel
-
Tree List
- Overview
-
Data Binding
- Sorting
- Paging
-
Editing
- Node Drag & Drop
- Focused Row
-
Selection
-
Filtering
-
Column Customization
- State Persistence
- Adaptability
- Keyboard Navigation
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Features
- Virtual Scrolling
-
Grouping
-
Customization
- Adaptability
-
Html Editor
-
Chat
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
Charts
- Overview
-
Data Binding
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Line Charts
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
-
Sparkline Charts
-
Tree Map
-
Funnel and Pyramid Charts
- Sankey Chart
-
Combinations
-
More Features
-
Export
-
Selection
-
Tooltips
-
Zooming
-
-
Gantt
- Overview
-
Data
-
UI Customization
- Strip Lines
- Export to PDF
- Sorting
-
Filtering
-
Gauges
- Overview
-
Data Binding
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Navigation
- Overview
- Accordion
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
- Pagination
-
Tree View
- Right-to-Left Support
-
Layout
-
Editors
- Overview
- Autocomplete
-
Calendar
- Check Box
- Color Box
-
Date Box
-
Date Range Box
-
Drop Down Box
-
Number Box
-
Select Box
- Switch
-
Tag Box
- Text Area
- Text Box
- Validation
- Custom Text Editor Buttons
- Right-to-Left Support
- Editor Appearance Variants
-
Forms and Multi-Purpose
- Overview
- Button Group
- Field Set
-
Filter Builder
-
Form
- Radio Group
-
Range Selector
- Numeric Scale (Lightweight)
- Numeric Scale
- Date-Time Scale (Lightweight)
- Date-Time Scale
- Logarithmic Scale
- Discrete scale
- Custom Formatting
- Use Range Selection for Calculation
- Use Range Selection for Filtering
- Image on Background
- Chart on Background
- Customized Chart on Background
- Chart on Background with Series Template
- Range Slider
- Slider
-
Sortable
-
File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Actions and Lists
- Overview
-
Action Sheet
-
Button
- Floating Action Button
- Drop Down Button
-
Context Menu
-
List
-
Lookup
-
Maps
- Overview
-
Map
-
Vector Map
-
Dialogs and Notifications
-
Localization
JavaScript/jQuery Data Grid - Column Chooser
To change column visibility at runtime, set the columnChooser.enabled property to true. To make certain that a given column(s) always stay visible, set the columns[].allowHiding property to false.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
const columnChooserModes = [{
key: 'dragAndDrop',
name: 'Drag and drop',
}, {
key: 'select',
name: 'Select',
}];
$(() => {
const dataGrid = $('#employees').dxDataGrid({
dataSource: employees,
keyExpr: 'ID',
columns: [{
dataField: 'FirstName',
allowHiding: false,
}, 'LastName', 'Position', 'City', 'State', {
caption: 'Contacts',
columns: [{
dataField: 'MobilePhone',
allowHiding: false,
}, 'Email', {
dataField: 'Skype',
visible: false,
}],
}, {
dataField: 'HireDate',
dataType: 'date',
}],
columnAutoWidth: true,
showRowLines: true,
width: '100%',
showBorders: true,
columnChooser: {
height: "340px",
enabled: true,
mode: columnChooserModes[1].key,
position: {
my: 'right top',
at: 'right bottom',
of: '.dx-datagrid-column-chooser-button',
},
search: {
enabled: true,
editorOptions: { placeholder: 'Search column' },
},
selection: {
recursive: true,
selectByClick: true,
allowSelectAll: true,
},
},
}).dxDataGrid('instance');
$('#columnChooserMode').dxSelectBox({
items: columnChooserModes,
value: columnChooserModes[1].key,
inputAttr: { 'aria-label': 'Column Chooser Mode' },
valueExpr: 'key',
displayExpr: 'name',
onValueChanged(data) {
dataGrid.option('columnChooser.mode', data.value);
const isDragMode = columnChooserModes[0].key === data.value;
$('#allowSelectAll').dxCheckBox('instance').option('disabled', isDragMode);
$('#selectByClick').dxCheckBox('instance').option('disabled', isDragMode);
$('#recursive').dxCheckBox('instance').option('disabled', isDragMode);
},
});
$('#searchEnabled').dxCheckBox({
text: 'Search enabled',
value: true,
onValueChanged(data) {
dataGrid.option('columnChooser.search.enabled', data.value);
},
});
$('#allowSelectAll').dxCheckBox({
text: 'Allow select all',
value: true,
onValueChanged(data) {
dataGrid.option('columnChooser.selection.allowSelectAll', data.value);
},
});
$('#selectByClick').dxCheckBox({
text: 'Select by click',
value: true,
onValueChanged(data) {
dataGrid.option('columnChooser.selection.selectByClick', data.value);
},
});
$('#recursive').dxCheckBox({
text: 'Recursive',
value: true,
onValueChanged(data) {
dataGrid.option('columnChooser.selection.recursive', data.value);
},
});
});
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
To display the column chooser, click the appropriate toolbar button above the JavaScript DataGrid. You can specify the column chooser's position via the columnChooser.position property. The manner in which users can display/hide columns depends on columnChooser.mode:
-
"dragAndDrop"
Users can drag and drop column headers to and from the column chooser. -
"select"
Users can select and deselect check boxes with column names.
In "select" mode, you can choose whether parent element selection affects child/nested elements. Use the selection.recursive property for this purpose.
If the column chooser contains multiple hidden columns, you can enable the DevExtreme Grid’s column search UI. Assign true to the search.enabled property for this purpose.
In this demo, use the check boxes below the JavaScript DataGrid to toggle search and selection features.
To hide a column in code, set the columns[].visible property to false.