Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<div id="data-grid-demo">
<dx-data-grid [dataSource]="payments">
<dx-data-grid
[dataSource]="payments"
(onEditorPreparing)="onEditorPreparing($event)"
>
<dxi-data-grid-column
dataField="PaymentId"
[caption]="formatMessage('Number')"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { bootstrapApplication } from '@angular/platform-browser';
import { Component, enableProdMode, provideZoneChangeDetection } from '@angular/core';
import { DxSelectBoxModule, DxDataGridModule } from 'devextreme-angular';
import { DxDataGridTypes } from 'devextreme-angular/ui/data-grid';

import 'devextreme/common/core/localization/globalize/number';
import 'devextreme/common/core/localization/globalize/date';
Expand Down Expand Up @@ -64,6 +65,12 @@ export class AppComponent {
Globalize.loadMessages(this.service.getDictionary());
}

onEditorPreparing(e: DxDataGridTypes.EditorPreparingEvent) {
if (e.dataField === 'Amount' && e.parentType === 'filterRow') {
e.editorOptions.inputAttr = { 'aria-label': 'Filter cell' };
}
}

changeLocale(data) {
this.setLocale(data.value);
parent.document.location.reload();
Expand Down
10 changes: 9 additions & 1 deletion apps/demos/Demos/Localization/UsingGlobalize/React/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { useCallback, useState } from 'react';
import DataGrid, { Column, Editing, FilterRow } from 'devextreme-react/data-grid';
import DataGrid, {
Column, Editing, FilterRow, type DataGridTypes,
} from 'devextreme-react/data-grid';
import SelectBox, { type SelectBoxTypes } from 'devextreme-react/select-box';

import 'devextreme/common/core/localization/globalize/number';
Expand All @@ -26,6 +28,11 @@ const amountEditorOptions = {
format: 'currency',
showClearButton: true,
};
const onEditorPreparing = (e: DataGridTypes.EditorPreparingEvent) => {
if (e.dataField === 'Amount' && e.parentType === 'filterRow') {
e.editorOptions.inputAttr = { 'aria-label': 'Filter cell' };
Comment thread
flagmanAndrew marked this conversation as resolved.
}
};
const selectBoxInputAttr = { id: 'selectInput' };

Globalize.load(
Expand Down Expand Up @@ -54,6 +61,7 @@ const App = () => {
<DataGrid
dataSource={payments}
keyExpr="PaymentId"
onEditorPreparing={onEditorPreparing}
>
<Editing
mode="popup"
Expand Down
6 changes: 6 additions & 0 deletions apps/demos/Demos/Localization/UsingGlobalize/ReactJs/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ const amountEditorOptions = {
format: 'currency',
showClearButton: true,
};
const onEditorPreparing = (e) => {
if (e.dataField === 'Amount' && e.parentType === 'filterRow') {
e.editorOptions.inputAttr = { 'aria-label': 'Filter cell' };
}
};
const selectBoxInputAttr = { id: 'selectInput' };
Globalize.load(deCldrData, ruCldrData, supplementalCldrData);
Globalize.loadMessages(deMessages);
Expand All @@ -44,6 +49,7 @@ const App = () => {
<DataGrid
dataSource={payments}
keyExpr="PaymentId"
onEditorPreparing={onEditorPreparing}
>
<Editing
mode="popup"
Expand Down
14 changes: 12 additions & 2 deletions apps/demos/Demos/Localization/UsingGlobalize/Vue/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<DxDataGrid
:data-source="payments"
key-expr="PaymentId"
@editor-preparing="onEditorPreparing"
>
<DxEditing
:allow-updating="true"
Expand Down Expand Up @@ -60,7 +61,7 @@
<script setup lang="ts">
import { onBeforeMount, ref } from 'vue';
import {
DxDataGrid, DxColumn, DxEditing, DxFilterRow,
DxDataGrid, DxColumn, DxEditing, DxFilterRow, type DxDataGridTypes,
} from 'devextreme-vue/data-grid';
import DxSelectBox, { type DxSelectBoxTypes } from 'devextreme-vue/select-box';
import 'devextreme/common/core/localization/globalize/number';
Expand All @@ -80,7 +81,10 @@ const locales: { Name: string, Value: Locale }[] = service.getLocales();
const payments: Record<string, string | number>[] = service.getPayments();
const locale: Locale = getLocale();
const editPopupOptions = { width: 700, height: 345 };
const amountEditorOptions = { format: 'currency', showClearButton: true };
const amountEditorOptions = {
format: 'currency',
showClearButton: true,
};
const selectBoxInputAttr = { id: 'selectInput' };
const formatMessage = ref((msg: string) => msg);

Expand Down Expand Up @@ -109,6 +113,12 @@ function initGlobalize() {
formatMessage.value = Globalize.formatMessage.bind(Globalize);
}

function onEditorPreparing(e: DxDataGridTypes.EditorPreparingEvent) {
if (e.dataField === 'Amount' && e.parentType === 'filterRow') {
e.editorOptions.inputAttr = { 'aria-label': 'Filter cell' };
}
}

function changeLocale({ value }: DxSelectBoxTypes.ValueChangedEvent) {
setLocale(value);
document.location.reload();
Expand Down
5 changes: 5 additions & 0 deletions apps/demos/Demos/Localization/UsingGlobalize/jQuery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ $(() => {
height: 345,
},
},
onEditorPreparing: (e) => {
if (e.dataField === 'Amount' && e.parentType === 'filterRow') {
e.editorOptions.inputAttr = { 'aria-label': 'Filter cell' };
}
},
};

const selectBoxOptions = {
Expand Down
3 changes: 0 additions & 3 deletions apps/demos/testing/common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ const getIgnoredRules = (testName) => {
}

const specificRules = {
'DataGrid-EditStateManagement': ['aria-required-parent'],
'DataGrid-RemoteCRUDOperations': ['scrollable-region-focusable'],

'Diagram-Adaptability': ['aria-dialog-name', 'label'],
'Diagram-AdvancedDataBinding': ['aria-dialog-name', 'label'],
'Diagram-Containers': ['aria-dialog-name', 'label'],
Expand Down
Loading