Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataGrid - Selected (Blanks) in the header filter should be applied if the Filter Row and Filter Panel is visible #28415

Open
wants to merge 2 commits into
base: 24_2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Expand Up @@ -10,6 +10,46 @@ fixture.disablePageReloads`Header Filter`

const GRID_CONTAINER = '#container';

test('Data should be filtered if (Blank) is selected in the header filter (T1257261)', async (t) => {
const result: string[] = [];
const dataGrid = new DataGrid(GRID_CONTAINER);
const headerCell = dataGrid.getHeaders().getHeaderRow(0).getHeaderCell(1);
const dataCell = dataGrid.getDataRow(0).getDataCell(0);
const filterIconElement = headerCell.getFilterIcon();
const headerFilter = new HeaderFilter();
const buttons = headerFilter.getButtons();
const list = headerFilter.getList();

await t.click(filterIconElement)
.click(list.getItem(1).element)
.click(buttons.nth(0));

result[0] = await dataCell.element().innerText;

await t.click(filterIconElement)
.click(filterIconElement)
.click(list.getItem(1).element)
.click(list.getItem(0).element)
.click(buttons.nth(0));

result[1] = await dataCell.element().innerText;

await t.expect(result[0]).eql('1')
.expect(result[1]).eql('2');
}).before(async () => createWidget('dxDataGrid', {
dataSource: [
{ ID: 1, Text: 'Item 1' },
{ ID: 2, Text: '' },
{ ID: 3, Text: 'Item 3' },
],
keyExpr: 'ID',
showBorders: true,
remoteOperations: true,
headerFilter: { visible: true },
filterRow: { visible: true },
filterPanel: { visible: true },
}));

test('HeaderFilter icon should be grayed out after the clearFilter call (T1193648)', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const dataGrid = new DataGrid(GRID_CONTAINER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const normalizeFilterValue = function (that, filterValue, column, $editorContain
};

const updateFilterValue = function (that, options) {
const value = options.value === '' ? null : options.value;
const { value } = options;
const $editorContainer = options.container;
const column = that._columnsController.columnOption(options.column.index);
const filterValue = getFilterValue(that, column.index, $editorContainer);
Expand Down
Loading