Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added valueMapper config option

  • Loading branch information...
commit 31421bd7b151819f2d52f821ddbfd6e019ed3676 1 parent ef01ae3
@kristianmandrup authored
Showing with 21 additions and 2 deletions.
  1. +19 −1 README.md
  2. +2 −1  SliderFieldExtended.js
View
20 README.md
@@ -20,7 +20,25 @@ This is an extended version of the Sencha Touch 2 Slider field with added helper
minValue: 0,
maxValue: 100,
increment: 0.25
- },
+ }
+
+## Using a custom valueMapper
+
+ {
+ xtype: 'sliderfieldextended',
+ name: 'slider_decimal',
+ labelText: 'Decimal',
+ label: 'Decimal',
+ value: 0,
+ minValue: 0,
+ maxValue: 2,
+ increment: 1,
+ valueMapper: function(value) {
+ self.config.valueMap[value];
+ }
+ valueMap: ['A', 'B', 'C']
+ }
+
# Screenshots
View
3  SliderFieldExtended.js
@@ -64,7 +64,8 @@ Ext.define('Ext.field.SliderExtended', {
},
setHelperValue: function(value) {
- var value = value;
+ var valueMapper = self.config.valueMapper;
+ var value = valueMapper ? valueMapper(value) : value;
this.helperInput.dom.value = value;
},
Please sign in to comment.
Something went wrong with that request. Please try again.