-
29 Jun 2012 9:32 AM #1
Answered: Labels for "custom" form fields
Answered: Labels for "custom" form fields
I want to make a form field that functions mostly like a slider or spinner: the user can select an integer from 1-6. However, it should appear as a row of 6 buttons side-by-side, each labeled with its numerical value. So instead of moving a circle to an unlabeled position on a number line, you click the number you want.
I could put an hbox panel inside the fieldset and put the buttons inside that panel, but that wouldn't let me give it a label consistent with the other labels in the form.
Is there any way to create this kind of "custom" field and have it behave like other fields, especially in terms of how it is labeled?
This question is generalized to all custom fields, not just the specific example of the row of buttons, because I have other "custom" fields that I'd like to put in my form.
-
Best Answer Posted by jerome76
Have you seen this thread?
http://www.sencha.com/forum/showthread.php?219848-Ext.tux.form.FieldContainer-Create-complex-form-fields
If I am reading your comment correctly, maybe that can help you out
-
29 Jun 2012 10:08 AM #2
I just use something like this:
Code:{ xtype: 'sliderfield', label: 'Value: 50', value: 50, minValue: 0, maxValue: 100, listeners: { drag: function(me){ me.setLabel('Value: ' + me.getValue()); } } }
-
29 Jun 2012 10:59 AM #3
I'll do that if I can't figure out how to make the row of number buttons, but I prefer the look of the number buttons and the solution I use would also help for other "custom" fields that have no way of being functionally replicated by existing fields. (Since this question is generalized to all fields that would basically be built by hbox panels within fieldsets, not just the number picker.)
-
29 Jun 2012 11:11 AM #4
Have you seen this thread?
http://www.sencha.com/forum/showthread.php?219848-Ext.tux.form.FieldContainer-Create-complex-form-fields
If I am reading your comment correctly, maybe that can help you out


Reply With Quote