GravityKit / GravityView

The best and easiest way to display Gravity Forms entries on your website.
https://www.gravitykit.com/products/gravityview/
245 stars 62 forks source link

Add number range search options #2020

Closed doekenorg closed 2 months ago

doekenorg commented 3 months ago

This PR addresses #1426 by adding a new number_range field for number, quantity and total fields. For products this isn't possible as the field itself contains both a name AND a price.

This PR also resolves an issue with the removal of CAST functions from the query, that we actually still need in order to match numeric values.

image

min-max

There is some JS that prevents the From field from being higher than the value of the To field, and vice versa. There is also a backup validation with an error message if someone gets around it.

doekenorg commented 3 months ago
rafaehlers commented 3 months ago

I'm not sure if the input type="number" is the best approach here because it prevents us from searching float/currency numbers: https://www.loom.com/share/fb6dfbdb34684449b8373e18c1efb66e

image

doekenorg commented 3 months ago

I'm not sure if the input type="number" is the best approach here because it prevents us from searching float/currency numbers: https://www.loom.com/share/fb6dfbdb34684449b8373e18c1efb66e

image

@rafaehlers that's because the step.size is 1 by default. But that can be set to 0.01.

But there might be a better solution. The nice thing about number is that it has the native min and max.

mrcasual commented 3 months ago

@doekenorg, please take a look at this: https://www.loom.com/share/96864d158a8b46dc987a86e4f361c7bb

mrcasual commented 3 months ago

@doekenorg, also, are you able to add support for the product (user-defined price) field?