Kendo UI Grid中的多行支持 [英] Multiline support in Kendo UI Grid

查看:358
本文介绍了Kendo UI Grid中的多行支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Kendo UI Grid中有一列具有以下定义的列

I am having a column with following definition in Kendo UI Grid

fields: {
        column1: {type:"string",editable: false},
}

columns: [
{field: "column1",title:"Column1",width: 600}, 
]

该列在数据库中具有VARCHAR2(4000)作为数据大小,并且可以包含很少的段落的巨大数据.显然,它有多行.

The column is having VARCHAR2(4000) as a data size in DB and can have huge data with few paragraphs. Obviously it is having more than one lines.

输入的列将以回车符和特殊字符存储在数据库中.

The column when entered is being stored in DB with carriage returns and special characters.

但是当它在Kendo UI网格中呈现时,所有字符都显示在单行中.

But when it is rendered in Kendo UI Grid all the characters appear in single line.

要进行编辑,我可以应用textarea编辑器,并且可以查看多行.

For editing I can apply textarea editor and multiple lines can be viewed.

var textEditorInitialize = function(container, options) {
        $('<textarea name="' + options.field + '" style="width: ' + container.width() + 'px;height:' + container.height() + 'px" />').appendTo(container);
    };

但是,在网格中查看时,如何以多行显示此列的数据?

But, how to display the data in multi-lines for this column when viewed in grid?

试图在开发者论坛上进行搜索,但没有任何忠实的投入.

Tried searching this on dev forums but haven't got any faithful inputs.

请建议相同的任何链接/指针.

Do suggest any links/pointers for the same.

推荐答案

使用white-space: pre-line设置单元格的样式.这将折叠大多数空格,但换行符(在<br/>上加换行).

Style the cells with white-space: pre-line. This will collapse most whitespace, but line break at newlines (plus on <br/>).

这篇关于Kendo UI Grid中的多行支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆