getCell(row,col)在GWT HTMLTable中 [英] getCell(row,col) in GWT HTMLTable
问题描述
Cell c = getCell(row,col);
在HTML / Flex表格中获取单元格的最有效方法是什么?
取决于你想要做什么。如果要读取/写入单元格的内容,可能需要使用 HTMLTable#setText(int,int)
和 HTMLTable#getText( int,int)
或 HTMLTable#setWidget(int,int)
和 HTMLTable#getWidget(int,int)
,如果单元格的内容是一个控件。
在 HtmlTable.CellFormatter
(链接到gwt javadoc )及其子类 - 您可以使用 HTMLTable#getCellFormatter()
获取它,它取决于你正在使用的 HTMLTable
的实现。例如,使用单元格格式化程序,您可以设置/删除样式,属性或获取底层的 Element
(链接到gwt javadoc ),以便更直接地进行控制。
There is no such method in HTMLTable:
Cell c = getCell(row,col);
What is the most effective way of getting a cell in an HTML/Flex Table, given the row and column?
Depends on what you want to do.
If you want to read/write the content of the cell, you might want to use HTMLTable#setText(int,int)
and HTMLTable#getText(int,int)
, or HTMLTable#setWidget(int,int)
and HTMLTable#getWidget(int,int)
, if the content of the cell is a widget.
There are more functions to read/write properties of the cell in HtmlTable.CellFormatter
(link to gwt javadoc) and its subclasses - you can obtain it using HTMLTable#getCellFormatter()
and maybe cast it, depending on the implementation of HTMLTable
you are using. with the cell formatter you can, for example, set/remove styles, attributes or get the underlying Element
(link to gwt javadoc) for even more direct control.
这篇关于getCell(row,col)在GWT HTMLTable中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!