简体   繁体   English

Kendo Grid 调整屏幕大小时设置最小列宽

[英]Kendo Grid set the minimum column width when screen is resizing

How to set the minimum column width of kendo grid when screen is resizing?调整屏幕大小时如何设置剑道网格的最小列宽 For example I had this grid and I want to set the Description column min width to 300px例如我有这个网格,我想将Description列的最小宽度设置为300px

I have tried:我试过了:

  1. media: "(min-width: 300px)"
  2. I found this article but it only works if resizing the column in the grid.我找到了这篇文章,但只有在调整网格中的列大小时它才有效。

DEMO IN DOJO演示 DOJO

Try using a row template, this will allow you to target individual columns with CSS and further customise sizing with using Media Queries.尝试使用行模板,这将允许您使用 CSS 定位单个列,并使用媒体查询进一步自定义大小。

https://demos.telerik.com/kendo-ui/grid/rowtemplate https://demos.telerik.com/kendo-ui/grid/rowtemplate

Instead of directly putting css to element you can add class to parent element of Grid and catch the grid column class using that parent element class and then add the media query on that.您可以将 class 添加到 Grid 的父元素,并使用该父元素 class 捕获网格列 class,然后在其上添加媒体查询,而不是直接将 css 放入元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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