jQuery jPicker reset completely

前端 未结 3 478
情书的邮戳
情书的邮戳 2021-01-22 03:07

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

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-22 03:39

    As explained above you could try something like this :

    var id =$.jPicker.List[i].id; //getting the id of the element you've binded jpicker with
    $.jPicker.List[i].destroy(); //destroying the instance in the jPicker List
    $("#"+id).parent().find('span.jPicker').remove(); // destroying the span containing the graphical jPicker
    $("#"+id).jPicker(); // And finally reinstancing the jPicker instance on your element
    

    It should make blink your picker (removing then recreating).

提交回复
热议问题