问题描述
我们正在寻找一个使用 Tabulator 的弹出式编辑器(最好是 textarea)的工作示例.有没有人知道或知道其中一个工作示例?
We are seeking a working example of a popup editor (ideally textarea) using Tabulator. Does anyone have or know of one of a working example?
制表人员说这取决于开发人员 https://github.com/olifolkerd/tabulator/issues/2048.虽然我们可以看到没有将它作为 Tabulator 的一部分提供,但一个展示如何将它粘合在一起的例子会很好,因为它是与 Tabulator 集成的.
The Tabulator folks say this is up to the dev https://github.com/olifolkerd/tabulator/issues/2048. And while we can see not providing this as part of Tabulator proper, an example showing how to glue it together would be nice because it is Tabulator the integration is with.
是的,我们知道还有其他网格已经具备此功能,但它们尚未满足我们在 Tabulator 拥有的其他领域的需求,因此我们真的很想用 Tabulator 解决这个问题.
And yes, we are aware there are other grids that have this already, but they have not met our needs in other areas that Tabulator has, so we'd really like to tackle this with Tabulator.
这是使用 JQuery UI 对话框的粗略开始,但我们无法弄清楚如何获取单元格值以更新和关闭对话框 https://jsfiddle.net/1kmrLoj8/16/
Here is a rough start using a JQuery UI dialog, but we cannot figure out how to get he cell value to update and close the dialog https://jsfiddle.net/1kmrLoj8/16/
function onChange(e){
if(((cell.getValue() === null || typeof cell.getValue() === "undefined") && editor.value !== "") || editor.value !== cell.getValue()){
if(success(editor.value)){
cell.setValue(editor.value); //persist value if successfully validated incase editor is used as header filter
$(dialog).dialog('close'); //does not work
}
}else{
cancel();
$(dialog).dialog('close'); //does not work
}
}
推荐答案
Tabulator 仅用于显示表格,它不会在表格本身之外创建元素.
Tabulator is only built to display tables, it does not create an elements outside of the table itself.
如果您想使用模态或弹出窗口,那么我建议您选择适合您需求的 3rd 方模态库,并从 Tabulator 中的事件触发它.
If you want to use modals or popups then i would suggest choosing a 3rd party modal library that works for your needs and trigger it from an event in Tabulator.
如果您希望它充当编辑器,那么我建议在 cellClick 或 RowClick 上触发模式em> 事件.
If you want it to act as an editor then i would suggest triggering the modal on the cellClick or RowClick events.
这些事件会传入一个 组件对象,表示已单击的单元格或行.然后您可以在这些对象上调用函数来更改表中的任何更新数据
These events get pass in a Component Object representing the cell or row that has been clicked. you can then call functions on these objects to change any updated data in the table
这篇关于有没有人有或知道 Tabulator 的自定义弹出编辑器的任何示例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!