Skip to content

Commit

Permalink
fix(plugins): add missing Row Detail filtering code
Browse files Browse the repository at this point in the history
- get the item data context from its parrent object when using row detail
  • Loading branch information
ghiscoding committed Jan 20, 2021
1 parent 563c0fa commit 2874fd7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/common/src/interfaces/gridOption.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
HeaderMenu,
Locale,
Pagination,
// RowDetailView,
RowDetailView,
RowMoveManager,
RowSelectionModelOption,
TextExportOption,
Expand Down Expand Up @@ -435,7 +435,7 @@ export interface GridOption {
registerExternalResources?: ExternalResource[];

/** Row Detail View Plugin options & events (columnId, cssClass, toolTip, width) */
// rowDetailView?: RowDetailView;
rowDetailView?: RowDetailView;

/** Grid row height in pixels (only type the number). Row of cell values. */
rowHeight?: number;
Expand Down
12 changes: 6 additions & 6 deletions packages/common/src/services/filter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,12 @@ export class FilterService {
}

// Row Detail View plugin, if the row is padding we just get the value we're filtering on from it's parent
// if (this._gridOptions.enableRowDetailView) {
// const metadataPrefix = this._gridOptions.rowDetailView && this._gridOptions.rowDetailView.keyPrefix || '__';
// if (item[`${metadataPrefix}isPadding`] && item[`${metadataPrefix}parent`]) {
// item = item[`${metadataPrefix}parent`];
// }
// }
if (this._gridOptions.enableRowDetailView) {
const metadataPrefix = this._gridOptions.rowDetailView && this._gridOptions.rowDetailView.keyPrefix || '__';
if (item[`${metadataPrefix}isPadding`] && item[`${metadataPrefix}parent`]) {
item = item[`${metadataPrefix}parent`];
}
}

const dataKey = columnDef.dataKey;
let queryFieldName = columnDef.filter?.queryField || columnDef.queryFieldFilter || columnDef.queryField || columnDef.field || '';
Expand Down

0 comments on commit 2874fd7

Please sign in to comment.