简体   繁体   English

使用Textarea进行多行输入的Dgrid Editor

[英]Dgrid Editor using Textarea for multiple lines input

Below is the code snippet for my Dgrid's column. 以下是我的Dgrid专栏的代码段。 I tried to use the TextArea editor plugin to input multiple lines. 我试图使用TextArea编辑器插件输入多行。 However every time when I tried press enter for the second line the editor is closed and out of edit-mode. 但是,每当我尝试按Enter键进入第二行时,编辑器都会关闭并退出编辑模式。

var columns: [{ field: 'Name', 
                label: 'Name', 
                sortable: false, 
                editor: "textarea", 
                editOn: "dblclick" }]

在此处输入图片说明

My questions are: 我的问题是:

  1. Can anyone advice how to overwrite the keyboard event for Editor plugin? 谁能建议如何覆盖Editor插件的键盘事件? eg "enter" key for this case 例如这种情况下的“输入”键
  2. If the keyboard event "enter" is overwritten, what is the best way to tell the editor to exit edit-mode? 如果键盘事件“输入”被覆盖,告诉编辑器退出编辑模式的最佳方法是什么? eg mouse-click any area outside of the textarea? 例如,鼠标单击文本区域之外的任何区域?

Thanks in advance. 提前致谢。

I think what you're looking for is dimissOnEnter . 我认为您正在寻找的是dimissOnEnter If you set that to false when initializing your editor, then pressing enter will not exit edit mode of a textarea 如果在初始化编辑器时将其设置为false ,则按Enter不会退出文本区域的编辑模式。

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

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