reiniger Posted June 5, 2012 Report Share Posted June 5, 2012 (edited) Sveiki. $('.date_').datepicker(); $('#add').click(function(){ $('.first').clone().removeClass('first').appendTo("#dataTable"); $(".date_").datepicker(); }); Pirmajam elementam strādā, bet klonētajiem ne. Kā panākt ka datepicker() strādā klonētajam elementam? Šeit mazs piemers ka tas varētu strādāt. http://jsfiddle.net/reiniger/9FZyf/ Edited June 5, 2012 by reiniger Quote Link to comment Share on other sites More sharing options...
0 codez Posted June 5, 2012 Report Share Posted June 5, 2012 Tas tāpēc, ka datepicker pieliek klasi hasDatepicker un tiem otreiz netaisa funkcionalitāti, bet klonējot tu noklonē šo klasi: http://jsfiddle.net/9FZyf/10/ Quote Link to comment Share on other sites More sharing options...
0 reiniger Posted June 5, 2012 Author Report Share Posted June 5, 2012 codez tavs variants ljauj mainit tikai pirmajam elementam datumu. nice1 tavs variants der. Vēl atradu variantu ar tabulu ja kādam nepieciešams. http://www.library.beginnercode.com/jQuery/inputs_on_the_fly/cloneDatepicker.php Quote Link to comment Share on other sites More sharing options...
0 reiniger Posted June 5, 2012 Author Report Share Posted June 5, 2012 Sveiki. Gala rezultāts izmantojot codez. Ar clone() http://jsfiddle.net/reiniger/9FZyf/13/ Quote Link to comment Share on other sites More sharing options...
0 indoom Posted June 5, 2012 Report Share Posted June 5, 2012 http://jsfiddle.net/9FZyf/15/ Quote Link to comment Share on other sites More sharing options...
Question
reiniger
Sveiki.
Pirmajam elementam strādā, bet klonētajiem ne.
Kā panākt ka datepicker() strādā klonētajam elementam?
Šeit mazs piemers ka tas varētu strādāt.
http://jsfiddle.net/reiniger/9FZyf/
Edited by reinigerLink to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.