javascript - reload datepicker dynamically -
ok have javascript object control elements on page such load html, undo, redo etc.
when undo, removes datepickers inputs should datepickers.
my code located here: http://jsfiddle.net/maniator/qawua/
i changed code inline json fiddle
it has 6 columns, 2 of them being datepickers start date , expiration.
when user clicks of undo or undo -- datepickers no longer work.
can please me out here?
thanks :-d
updated
still have issue, changed fiddle bit
i solved issue:
i added line both of undo clicks:
self.refreshdatepickers(); on create row added expiration:
case 'expiration': td.append($('<input>', {value: i, name: index+"["+topindex+"]", type: 'text', size: 30, id: 'to['+topindex+']', 'class': 'dp', 'index': topindex})); break; and added refreshdatepickers function:
refreshdatepickers: function(){ var self = this; $.each($('.dp'),function(){ var index = $(this).attr('index'); var tr = $(this).parent().parent(); $( "input[name='startdate["+index+"]'], input[name='expiration["+index+"]']", tr ).removeclass("hasdatepicker"); self.createdatepicker(index, tr); }) }
Comments
Post a Comment