extjs - 如何使用 EXTJ 从元素的 lastChild 中删除类名
问题描述
这可能非常容易破解,但我只是没有让它工作:我想从子节点中删除一个类:我正在访问 lastchild,如下所示:代码:
Ext.select(".item").elements[0].lastChild
o/p:
<table class="abc test hide test123">
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</table>
我想删除class="hide
" 并将其替换为class="show"
,因此它将呈现:
<table class="abc test show test123">
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</table>
这是整个结构的外观:
<div class="item">
<div></div>
<div class="abc test hide"></div>
<div class="abc5643"></div>
<div class="abide"></div>
<table class="abc test hide test123">
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</table>
</div>
<table>
父类的 lastchild 也是如此item
。
我怎样才能做到这一点?
解决方案
这是小提琴
推荐阅读
- python - PermissionError(13, 'Permission denied') 从虚拟主机服务上的 Python 脚本导入熊猫时
- matlab - 在matlab中使用normrand进行高斯分布是真的吗
- c# - 如何在 startup.cs 中添加 /.well-known/openid-configuration 路由以及控制器路由和角度路由?
- bash - 如何订阅文件创建事件?(MacOS,Linux)
- java - 连接未关闭
- python - Discord py forward messages(with embeds) sent on one channel to another and how to determine number of members in a server?
- ruby-on-rails - Ruby 返回除非阻塞
- python - 在 Pandas 的不同列上创建几个值
- html - 如何在 jquery 中链接另一个页面上的特定 div 内容?
- database - 在 PostgreSQL 中创建多列索引