首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何设计GWT CellList的样式?

如何设计GWT CellList的样式?
EN

Stack Overflow用户
提问于 2012-07-28 19:06:49
回答 2查看 2.3K关注 0票数 1

我有一个CellList,我想设置它的样式。我想要更改光标样式,即选定单元格的丑陋颜色。我检查了几个关于堆栈溢出的问题和讨论,但没有一个有效。我检查了一下这个:

CellList GWT CSS Style

How do I style a gwt 2.1 CellTables headers?

这是我的代码:

代码语言:javascript
复制
public interface CellListResource extends CellList.Resources {


  public static CellListResource INSTANCE = GWT.create(CellListResource.class);

  interface CellListStyle extends CellList.Style {

  }

  @Source({CellList.Style.DEFAULT_CSS, "CellTableStyle.css"})
  CellListStyle style();
}

 public SearchViewImpl() {

    CompanyCell companyCell = new CompanyCell();
//it doesn't work :S 
    companiesList = new CellList<Company>(companyCell, CellListResource.INSTANCE);

    rootElement = ourUiBinder.createAndBindUi(this);

    loadingImage.setVisible(false);
  }

我是不是遗漏了什么?我清除了浏览器缓存,重启了服务器,F5 ....F5 (一次又一次地按刷新),什么也没有...!提前感谢您的帮助。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-11-27 12:47:25

确保注入css资源。

代码语言:javascript
复制
CellTableResources.INSTANCE.cellTableStyle().ensureInjected();
myCellTable = new CellTable<T>(Integer.MAX_VALUE,CellTableResources.INSTANCE);

你可以点击下面的链接

How do you change the mouse over highlighting?

票数 2
EN

Stack Overflow用户

发布于 2013-06-12 05:44:43

除了注入CSS之外,调用样式cellListStyle()而不仅仅是CellListStyle ()也很重要:

代码语言:javascript
复制
public interface CellListResource extends CellList.Resources {
  public static CellListResource INSTANCE = GWT.create(CellListResource.class);
  interface CellListStyle extends CellList.Style {}

  @Override
  @Source("cellListStyle.css")
  CellListStyle cellListStyle();
}

然后你就做了

代码语言:javascript
复制
CellListResource.INSTANCE.cellListStyle().ensureInjected();
companiesList = new CellList<Company>(companyCell, CellListResource.INSTANCE);
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11700458

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档