无法添加datepicker选项? [英] Can't add datepicker option?
问题描述
工作小提琴: http://jsfiddle.net/HermesTrismegistus/Bt9eU/
而且不工作的小提琴: http://jsfiddle.net/HermesTrismegistus/TTNEP/
它关于这一行:
$(。datepick)。
当我添加选项时..似乎停止运行。
$(。datepick)。datepicker(option,dateFormat,dd-mm-yy);
有人知道这个解决方案吗?
将两个datepicker实例更改为:
$(。datepick ).datepicker({dateFormat:dd-mm-yy});
您使用的代码在实例化日期戳之后用于更改选项。上述代码在实例化时设置选项。
I have a form wich dynamically creates a new row with a couple of form inputs. One of the inputs has a datepicker attached to it. I just managed with the help from here, to make this work. Except there is one problem left, as soon when i want to add options to the datepicker, it stops working...
Working fiddle: http://jsfiddle.net/HermesTrismegistus/Bt9eU/
And a not working fiddle: http://jsfiddle.net/HermesTrismegistus/TTNEP/
Its about this line:
$(".datepick").datepicker();
When i add the options to it.. It seems to stop functioning.
$(".datepick").datepicker("option", "dateFormat", "dd-mm-yy");
Does someone knows the solution to this?
Change both of your datepicker instances to:
$(".datepick").datepicker({ dateFormat: "dd-mm-yy" });
The code you were using works for changing options after you have instantiated a datepicker. The above code sets options when you instantiate it.
这篇关于无法添加datepicker选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!