如何在 Slickgrid 中正确使用格式化程序和编辑器 [英] How to properly use formatter and editor in Slickgrid

查看:35
本文介绍了如何在 Slickgrid 中正确使用格式化程序和编辑器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在 angular 指令中使用了 slickgrid.我们想在 Slickgrid 的单元格/列中使用另一个列表指令(带有输入的简单选择元素).

We are using slickgrid in our angular directive. And we would like to use another list directive (simple select element with input) in a cell/column of Slickgrid.

我希望列表元素在网格可用时可见,以便用户知道有一个列表.因此,我使用 list 指令作为格式化程序.当网格被渲染时它可见的.

I want the list element to be visible when the grid is available, so user knows there is a list. Therefor I am using the list directive as formatter. It Is visible when the grid is rendered.

当包含列表元素的单元格被点击时,由于列表元素点击事件,编辑器模式永远不会被触发.

When the cell that holds list element is clicked, the editor mode is never fired because of the list element click event.

我们想使用一个列表的图像,用户知道有一个列表,当点击时打开列表.

We thought to use an image of list that user knows there is a list, and when clicked open the list.

有没有更好的方法来做到这一点?

Is there a better way to do it?

推荐答案

我们已经成功地使用 list 指令作为我们的渲染器/格式化程序以及编辑器来完成它.

We have managed to get it done using list directive as our rendere/formatter as well as editor.

我们将列表指令设为只读,因此它不会触发点击事件.现在,当呈现网格时,人们会看到一个列表元素.当单击带有列表的单元格时,列表会通过代码自动打开.我们现在这个解决方案唯一的问题是如何将选定的项目从编辑器复制到格式化程序(如果有人知道,请分享).

We made our list directive as ReadOnly so it does not fire click event. And now one sees a list element when grid is rendered. And when one clicks on the cell with list, the list is automatically opened via code. The only problem we have now with this solution is that how to copy selected Item from editor to formatter (if anyone knows, please share).

也欢迎任何更好的解决方案.

Any better solution is also welcomed.

这篇关于如何在 Slickgrid 中正确使用格式化程序和编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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