admin管理员组文章数量:1384604
I have a grid in ExtJS where I am looping store items. I'd like to find a find to access the item's HTML element, but I'm having hard time finding the way to do this.
Simply put: how do you find the corresponding row HTML element for grid store's one record?
I have a grid in ExtJS where I am looping store items. I'd like to find a find to access the item's HTML element, but I'm having hard time finding the way to do this.
Simply put: how do you find the corresponding row HTML element for grid store's one record?
Share Improve this question asked Oct 7, 2011 at 20:34 TowerTower 103k131 gold badges364 silver badges521 bronze badges3 Answers
Reset to default 3Use its index in the store to retrieve the corresponding row, like so:
var htmlElement = grid.getView().getRow(index);
ExtJS 4.x: grid.getView().getNode(index)
getNode
can take an HTML ID (not very useful), an index, or a store record.
Just to add a little to it, if you've got a record that exists in a store that has a grid, but it came from say a separate ajax request, you might do
var objFromJSON: {
id: 134,
name: "Articulated Lorry"
}
var gridIndex = Ext.getStore("myStore").find("id", objFromJSON.id);
var htmlElement = grid.getView().getRow(gridIndex);
本文标签: javascriptGet row HTML element based on grid39s recordmodel in ExtJSStack Overflow
版权声明:本文标题:javascript - Get row HTML element based on grid's recordmodel in ExtJS - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744537951a2611429.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论