为什么子代未显示在jquery中? [英] Why the children are not shown in jquery?
问题描述
在以下代码中:
In the below code:
var grid = $('#grid1').data('kendoGrid');
var f = grid.tbody.find('tr.k-grouping-row');
grid.tbody.find('tr.k-grouping-row').each(function (e) { grid.collapseRow(this); });
console.log(grid.tbody.children().length);
为什么grid.tbody.children().length
为0而grid.tbody
有11个子代?
感谢您的回复!
我尝试过的事情:
我尝试使用grid.tbody[0].children()
,但是遇到未定义 grid.tbody[0].children()
.
Why grid.tbody.children().length
is 0 while grid.tbody
has 11 children?
Thanks for response!
What I have tried:
I try to use grid.tbody[0].children()
but I encounter that grid.tbody[0].children()
is not defined.
推荐答案
(#grid1').data( kendoGrid'); var f = grid.tbody.find(' tr. k-grouping-row'); grid.tbody.find(' tr.k-grouping-row').each(功能(e){grid.collapseRow( this );}); 控制台 .log(grid.tbody.children().length);
('#grid1').data('kendoGrid'); var f = grid.tbody.find('tr.k-grouping-row'); grid.tbody.find('tr.k-grouping-row').each(function (e) { grid.collapseRow(this); }); console.log(grid.tbody.children().length);
为什么grid.tbody.children().length
为0而grid.tbody
有11个子代?
感谢您的回复!
我尝试过的事情:
我尝试使用grid.tbody[0].children()
,但遇到未定义 grid.tbody[0].children()
的情况.
Why grid.tbody.children().length
is 0 while grid.tbody
has 11 children?
Thanks for response!
What I have tried:
I try to use grid.tbody[0].children()
but I encounter that grid.tbody[0].children()
is not defined.
将其用作属性
grid.tbody.children;
不是方法
not method
grid.tbody.children()
这篇关于为什么子代未显示在jquery中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!