简体   繁体   English

如何遍历 Extjs 网格的 DOM 元素?

[英]How to traverse through the DOM elements of a Extjs grid?

Basically I want to add a td class based on the value it has.基本上我想根据它的值添加一个 td class 。 I cannot apply this in the renderer because of the nature of the requirement.由于要求的性质,我不能在渲染器中应用它。 Meaning, a click event in the ExtJS grid[already rendered] requires revisiting all the rows and apply a td class based on the value/condition it posses.意思是,ExtJS 网格[已呈现] 中的单击事件需要重新访问所有行并根据它拥有的值/条件应用 td class。 Today we are reloading but we wanted to cut down because of performance.今天我们正在重新加载,但由于性能原因我们想减少。

My idea here is to traverse all the TR of the given grid and add a class based on the value.我的想法是遍历给定网格的所有 TR 并根据该值添加一个 class 。 Any suggestion how to take this forward.任何建议如何推进这一点。

Completed the requirement with the help of Ext.DomQuery.select在 Ext.DomQuery.select 的帮助下完成了需求

for (recordIdx of grid) Ext.DomQuery.select('.x-grid-cell-inner', grid.getNode(recordIdx)); for (recordIdx of grid) Ext.DomQuery.select('.x-grid-cell-inner', grid.getNode(recordIdx));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM