0
我动态地添加输入字段到td
元素jQuery UI的动态插入输入
$('.edit_text').live('click',function(){
$(this).html('<input type="text" value="'+$(this).text()+'" style="background:url(text_bx.gif) no-repeat bottom;display:inline;padding: 0; margin: 0;" class="editing" >');
$(this).children('input').focus();
if ($(this).attr('id')=='date'){
$(this).children('input').datepicker("refresh");//"option", "dateFormat","yy-mm-dd");
}
});
但如果TD具有标识日期,日期选择器没有显示出来。 我也有插入输入字段模糊功能,是一个问题?
$('.editing').live('blur',function(){
//did something
});
您可以张贴在的jsfiddle?也尝试使用一些不同的名称,而不是“日期”,这可能会让你陷入困境 – Samson 2012-07-14 19:18:42
代码有点复杂,我添加了console.log(0)if语句后,它的工作 – pahnin 2012-07-14 19:20:25