简体   繁体   中英

Kendo UI Grid Row Height set Dynamically by control

Previously when using the Kendo UI Grid control (version 2014.1.318), the height of any rows in my grid were fixed and ellipses were used to show any content outside the width of the cell - looking a little like the below:

它应该看起来如何

Now, since I upgraded to the latest version of the controls (2014.2.903), the height of the row seems to be adjusted to fit the content:

不是我想要的外观

The HTML for that row now contains the in-line style of the below, whereas previously it did not.

style="height: 45px;"

I'm guessing this is the problem. I want to know if there's a way to turn off this feature or where in the scripts I can remove this. I can't even find when this was introduced in the release history !

EDIT: I've identified the problem lies within the kendo.common.min.css file. If I use the old one, everything works fine... just got to find the new style that's causing the issue

You might consider providing your own CSS to adjust the Grid. I've provided an example here . The main CSS that would interest you being:

.k-grid table {
   table-layout: fixed;
}

.k-grid tbody tr{
    height: 50px;
}

.k-grid td{
    white-space: nowrap;
    text-overflow: ellipsis;
}

You can read more about this on the Telerik forums

Following up from Cody's CSS, the problem was found in the kendo.common.css file. I used the entire new set of files from 2014.2.903, but with that one file set to the 2014.1.318 version. Not sure what's changed in those files, as I ran a comparison and couldn't spot the offending line.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM