Skip to content

Commit

Permalink
ROU-4659: Open SetColumnFilterOptions to work with more column types (#…
Browse files Browse the repository at this point in the history
…386)

* Adding columns allowed for setColumnFilterOptions method

* Change ColumnFilter ErrorMessage

* Fix externalURL case sensitivity when checking externalURL

---------

Co-authored-by: rug <rmfgoncalves@gmail.com>
  • Loading branch information
OS-giulianasilva and rugoncalves committed Dec 19, 2023
1 parent 022b024 commit 76a88e8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
14 changes: 12 additions & 2 deletions src/Providers/DataGrid/Wijmo/Features/ColumnFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,17 @@ namespace Providers.DataGrid.Wijmo.Feature {
column.columnType ===
OSFramework.DataGrid.Enum.ColumnType.Text ||
column.columnType ===
OSFramework.DataGrid.Enum.ColumnType.Dropdown
OSFramework.DataGrid.Enum.ColumnType.Dropdown ||
column.columnType ===
OSFramework.DataGrid.Enum.ColumnType.Checkbox ||
column.columnType ===
OSFramework.DataGrid.Enum.ColumnType.Currency ||
column.columnType ===
OSFramework.DataGrid.Enum.ColumnType.Date ||
column.columnType ===
OSFramework.DataGrid.Enum.ColumnType.DateTime ||
column.columnType ===
OSFramework.DataGrid.Enum.ColumnType.Number
) {
// this column will have both filter types
this.changeFilterType(
Expand All @@ -369,7 +379,7 @@ namespace Providers.DataGrid.Wijmo.Feature {
).valueFilter.maxValues = maxVisibleOptions;
} else {
throw new Error(
`The SetColumnFilterOptions client action can only be applied to Text or Dropdowncolumns.`
`The SetColumnFilterOptions client action can only be applied to Text, Number, Currency, Dropdown, Checkbox, Date, DateTime Columns.`
);
}
} else {
Expand Down
5 changes: 4 additions & 1 deletion src/Providers/DataGrid/Wijmo/Helper/CellTemplateFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ namespace Providers.DataGrid.Wijmo.Helper.CellTemplateFactory {
let cellTemplate: wijmo.grid.ICellTemplateFunction;

const hasFixedText = binding.startsWith('$');
const hasExternalURL = externalURL?.substring(0, 4) === 'http';
const hasExternalURL = externalURL
?.toLocaleLowerCase()
.startsWith('http');

const url = hasExternalURL
? externalURL
: '${item.' + externalURL + '}';
Expand Down

0 comments on commit 76a88e8

Please sign in to comment.