If anyone experienced with jPicker, I would really like some help on this. I have a jPicker input box in a form, and when I post the form with Ajax, I try to reset the form back to it's original values. Except that I have no idea how to reset the jPicker box to it's original state, does anyone know how to do this?
相关问题
- Laravel Option Select - Default Issue
- How to fix IE ClearType + jQuery opacity problem i
- jQuery add and remove delay
- HTML form is not sending $_POST values
- How to use Control.FromHandle?
You can try to unbind the jPicker from the element and then rebind it after you want to reset it, should make it back to default settings.
As explained above you could try something like this :
It should make blink your picker (removing then recreating).
jPicker maintains the information for its control in the
$.jPicker.List[]
array. To remove the jPicker association with the control you will need to destroy its corresponding entry in the$.jPicker.List[]
array.Loop through the list of items in the array to find the one that references the control with
When you find your control in the array, destroy it with
After destroying the array element, you will need to remove the SPAN jPicker html object associated with the control. If there is only one you can
otherwise you will need to discover the specific html element
Optionally: if you are using class reference vs. id reference, use the .data() function to tag your control and use the following statement to retrieve the unique value