getCell(row,col)在GWT HTMLTable中 [英] getCell(row,col) in GWT HTMLTable

查看:134
本文介绍了getCell(row,col)在GWT HTMLTable中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆