SlickGrid: how to view full text for long cell entries?

与世无争的帅哥 提交于 2019-11-28 01:29:02

问题


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?


回答1:


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());



回答2:


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;
}


来源:https://stackoverflow.com/questions/11503076/slickgrid-how-to-view-full-text-for-long-cell-entries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!