Closed xavier-90 closed 4 years ago
If you have the value, you can check against the slider bounds by getting the slider current value, and seeing if you have the min or max. I'm not sure how well this solution works for non-range sliders, also.
I think you have misunderstood my request: I have implemented a split range slider. Out of the 2 values a user can change I need to know which one is being changed. The lower value or the upper value. I do not think there is any way of determining this within the formatter. Comparing against current set values is not an option as both values could change in one action. e.g. dragging the lower value beyond the upper value result in both values being updated.
Hi,
When using the formatter there is no way of knowing if the formatter is being called for the lower value or upper value, useful information if you wish to display different information in the formatted value.
One option would be to call the formatter with a second argument, e.g.:
Line 1202
var formattedTooltipVal = this.options.formatter(!tempState ? this._state.value[0] : tempState.value[0], 'min');
Line 1274formattedValue = this.options.formatter(this._state.value[0], 'min');
Line 1283formattedValue = this.options.formatter(this._state.value[1], 'max');
Line 1424var innerTooltipMinText = this.options.formatter(this._state.value[0], 'min');
Line 1427var innerTooltipMaxText = this.options.formatter(this._state.value[1], 'max');
Line 1434formattedTooltipVal = this.options.formatter(this._state.value[0], 'min');
Thanks, Xav