Number Filter
Use the Core number filter for prices, quantities, percentages, scores, and other numeric fields. It needs no Pro plugin.
Source code
TypeScriptts
grid.columns = [{ prop: 'price', name: 'Price', filter: 'number' }];
grid.filter = true;
return [{ price: 60 }, { price: 100 }, { price: 150 }, { price: 225 }];Quick start
Section titled “Quick start”const grid = document.querySelector('revo-grid')!;
grid.columns = [ { prop: 'price', name: 'Price', filter: 'number' }, { prop: 'quantity', name: 'Quantity', filter: 'number' },];grid.filter = true;grid.source = [ { price: 120, quantity: 2 }, { price: 80, quantity: 10 },];Operators
Section titled “Operators”| Saved ID | Popup label | Meaning |
|---|---|---|
eqN | = | Equal |
neqN | != | Not equal |
gt | > | Greater than |
gte | >= | Greater than or equal |
lt | < | Less than |
lte | <= | Less than or equal |
empty | Is blank | Uses the blank policy |
notEmpty | Is not blank | Inverse of the blank policy |
Numeric comparisons require the parsed cell value to be a number. Use cellParser when source values arrive as formatted strings.
Start with a numeric range
Section titled “Start with a numeric range”Use two conditions joined by and:
grid.filter = { multiFilterItems: { price: [ { id: 1, type: 'gte', value: 100, relation: 'and' }, { id: 2, type: 'lte', value: 500, relation: 'and' }, ], },};Parse formatted source values
Section titled “Parse formatted source values”grid.columns = [ { prop: 'price', name: 'Price', filter: 'number', cellParser: (model, column) => Number(String(model[column.prop] ?? '').replace(/[$,]/g, '')), },];Filtering and bounds-based Pro controls use the parsed number. Blank checks still use the original source value and own-property presence.
Choose Core conditions or a Pro control
Section titled “Choose Core conditions or a Pro control”Use Core operators when users know the exact threshold they want. Choose a visual control when the data shape should guide them:
- Slider Filter for a simple inclusive interval
- Histogram Brush for a range over a visible distribution
- Rating or Progress Threshold for stars, percentages, or scores
- Statistical Presets for relative population rules
Common mistakes
Section titled “Common mistakes”- Use
eqNfor numeric equality andeqfor text equality. - Convert numeric strings with
cellParser;gt,gte,lt, andltedo not treat arbitrary strings as numbers. - Keep
0distinct from blank unless your application explicitly changes the blank policy. - Use two conditions for a range; there is no Core
betweenoperator in the popup.