Hi,everyone.
In the Jmvc controller,I wrote a function like this:
/**
* When the page loads, gets all apply_reqs to be displayed.
*/
"{window} load": function(){
if(!$("#apply_req").length){
$(document.body).append($('<div></div>').attr('id','apply_req'));
Demoapp.Models.ApplyReq.findAll({}, this.callback('list'));
$("#date1").datepicker(); //at frist i put the code here , it doesn't work.
}
},
list: function( apply_reqs ){
$('#apply_req').html(this.view('init', {apply_reqs: apply_reqs} ));
$("#date1").datepicker();//when i put the code here ,it works correctly.
},
...
why?
thanks for helping.