[英]DataTable - Row against “each row”
can anybody explain me why the following code works properly 谁能解释一下以下代码为何正常工作
aDataTable.find('tbody').find('tr').each(function() {
var rowItems = $(this).children();
});
while the following 而以下
var rowItems = aDataTable.find('tbody').find('tr')[0].children();
reports the error: 报告错误:
"aDataTable.find(...).find(...)[0].children is not a function"
“ aDataTable.find(...)。find(...)[0] .children不是函数”
$(this)
is a jQuery object $(this)
是一个jQuery对象
aDataTable.find('tbody').find('tr')[0]
return an Element
aDataTable.find('tbody').find('tr')[0]
返回一个Element
like if you were doing this.children()
in the first function 就像您在第一个函数中执行
this.children()
you can use the function eq()
to get a jQuery object 您可以使用函数
eq()
获取jQuery对象
aDataTable.find('tbody').find('tr').eq(0).children()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.