I have an ExtJS TimeField where I use the setMinValue(...) and setMaxValue(...) to only show the valid time-elements to the user. This works just fine, but how do I reset the minValue and maxValue so that the user can see all the time-elements again?
I don't want to clear the field, just show all the elements from the store again.
I don't see any "clean" way to accomplish this, but I do have a temporary workaround until you find something more suitable.
Try setting the
TimeField'sminValueandmaxValuetoundefinedornull, and then callgenerateStore()on your TimeField:Yes it is a private method, so normally you shouldn't use it, but the method would normally be called if you simply reset minValue or maxValue, so you're just skipping a step. By setting both properties to null, the declaration for
var min, max =will be equal to the default. You can't go about this by callingsetMinValue()orsetMaxValue()because it uses a private method that attempts to parse a Date out of the value you pass to the methods (it will fail at parsing null):Update:
A cleaner approach would be to extend
TimeFieldand add aresetMinAndMaxmethod that accomplishes the above (set minValue/maxValue to null, call to generate store), or add the method in an override. That way you can avoid making calls to the "private"generateStore()everywhere.