function renderTable(data){
var getTpl = trList.innerHTML;
laytpl(getTpl).render(data, function(html){
$("#tableBody").html(html);
$('.chargeStartTime').each(function (index) {
console.log(index)
var _this = this
console.log(_this)
laydate.render({
elem: _this
, format: 'yyyy-MM-dd'
});
})
form.render();
});
}
$(’.chargeStartTime’).each(function (index) {} --获取批量日期标签DOM元素并遍历取值
var _this = this --将遍历到的this当前这一个DOM元素赋值到each方法的作用域内,再将其赋值到laydate.render方法的作用域内绑定日期选择框