SlickGrid: how to view full text for long cell ent

2019-01-25 19:32发布

I'm using a SlickGrid data table and some of my cells have very long text entries (1000 characters or more).

By default, SlickGrid only shows some of the text, and abbreviates the rest using an ellipsis.

This works well, except that I'd like to show the full text on mouseover, or have some other way to expand the cell to show the full entry.

Is this possible with SlickGrid, and if so how?

2条回答
三岁会撩人
2楼-- · 2019-01-25 20:03

Just use this plugin:

https://github.com/mleibman/SlickGrid/blob/master/plugins/slick.autotooltips.js

Register it like this and you are done!

mygrid.registerPlugin(new Slick.AutoTooltips());
查看更多
smile是对你的礼貌
3楼-- · 2019-01-25 20:29

By default, SlickGrid disables word wrap. Given that you have your cell height set correctly, you'd be able to see all of your cell's text by editing slick.grid.css like this:

.slick-cell, .slick-headerrow-column {
  position: absolute;
  border: 1px solid transparent;
  border-right: 1px dotted silver;
  border-bottom-color: silver;
  overflow: hidden;
  -o-text-overflow: ellipsis;
  text-overflow: ellipsis;
  vertical-align: middle;
  z-index: 1;
  padding: 1px 2px 2px 1px;
  margin: 0;
  /*white-space: nowrap;*/
  cursor: default;
}
查看更多
登录 后发表回答