当前位置: 首页 > news >正文

handsontable输入中文第一个字母丢失问题

首先查看 版本是否为最新版本 ,官网说 V14.4已经修复了问题

github上有解决方法https://github.com/handsontable/handsontable/issues/10773#issuecomment-1940713298

加上这个参数

:imeFastEdit="true"

另外说一下怎么重新实现将自带的功能(删除行/删除列等等)放到submenu中

首先自定义的二级菜单(submenu) 需要和外层定义的key 相同 并以 外层key:子级key的命名方式来实现,

在内部必须使用callback 来实现原有的功能 (不用自己完全实现)

关键点 直接使用 hot.alter('功能key名称', rowIndex, amount)

示例

items: { custom: { name: '行列操作', submenu: { items: [ { key: 'custom:remove_row', name: '删除行', callback() { const hot =getHotInstance() if (!hot) return const selected = hot.getSelectedLast() if (!selected) return const [startRow, , endRow] = selected const rowIndex = Math.min(startRow, endRow) const amount = Math.abs(endRow - startRow) + 1 hot.alter('remove_row', rowIndex, amount) } }, { key: 'custom:remove_col', name: '删除列', callback() { const hot = getHotInstance() if (!hot) return const selected = hot.getSelectedLast() if (!selected) return const [, startCol, , endCol] = selected const colIndex = Math.min(startCol, endCol) const amount = Math.abs(endCol - startCol) + 1 hot.alter('remove_col', colIndex, amount) } }, { key: 'sep1', name: '---------' }, { key: 'custom:col_left', name: '左侧插入列', callback() { const hot = getHotInstance() if (!hot) return const selected = hot.getSelectedLast() if (!selected) return const [, startCol, , endCol] = selected const colIndex = Math.min(startCol, endCol) hot.alter('insert_col_start', colIndex, 1) } }, { key: 'custom:col_right', name: '右侧插入列', callback() { const hot = getHotInstance() if (!hot) return const selected = hot.getSelectedLast() if (!selected) return const [, startCol, , endCol] = selected const colIndex = Math.max(startCol, endCol) + 1 hot.alter('insert_col_start', colIndex, 1) } }, { key: 'custom:row_above', name: '上方插入行', callback() { const hot = getHotInstance() if (!hot) return const selected = hot.getSelectedLast() if (!selected) return const [startRow, , endRow] = selected const rowIndex = Math.min(startRow, endRow) hot.alter('insert_row_above', rowIndex, 1) } }, { key: 'custom:row_below', name: '下方插入行', callback() { const hot = getHotInstance() if (!hot) return const selected = hot.getSelectedLast() if (!selected) return const [startRow, , endRow] = selected const rowIndex = Math.max(startRow, endRow) hot.alter('insert_row_below', rowIndex, 1) } } ] } }, } function getHotInstance(): Handsontable | null { return (hotTable.value?.hotInstance as Handsontable) ?? null }
http://www.jsqmd.com/news/694196/

相关文章:

  • 手把手教你用Python+PyTorch复现一个简易推荐系统(从协同过滤到双塔模型)
  • 范式终审:旧学术体系的非法性宣判与贾子理论的智慧公理重构
  • JetBrains IDE 试用期重置完全指南:30天无限续期的终极方案
  • VSCode日志配置“黑盒”终结者:用$HOME/.vscode/logs/下的12类时间戳日志文件反向定位崩溃根源
  • 营收下滑增长触顶,爱奇艺推“AI艺人库”降本却引用户愤怒
  • Docker里跑SVN,权限配置总踩坑?这份authz文件详解帮你搞定用户与分组管理
  • 在Ubuntu 22.04上搞定gnina:一个生物信息学小白的CUDA 11.8+Python 3.10完整配置手记
  • 西北工业大学物理学院复试资料电子版|14-18年真+实验视频+英语口语问答|考研冲刺必备
  • 为什么92%的C++26早期采用者在Release模式下静默禁用合约?真相与3种军工级启用策略
  • 收藏|2026年版AI大模型全维度学习路线,小白程序员零基础入门必看
  • BredOS:专为RK3588优化的Arch Linux Arm发行版解析
  • Harness工程深度解析:从理论到实践的完整指南
  • 手把手教你处理C# WinForm后台线程,告别窗体关闭后进程残留
  • 从光电效应实验到Python数据可视化:用Matplotlib复现普朗克常量测量全过程
  • 2026年3月西双版纳民宿名称,住宿/西双版纳民宿/民宿/西双版纳酒店/酒店/西双版纳住宿,西双版纳民宿费用推荐 - 品牌推荐师
  • Elasticsearch核心详解:Document文档概念与存储检索实战
  • 别再死记硬背了!用一张图+实战代码彻底搞懂UVM Phase的执行顺序
  • 掌握动态调优:FanControl智能风扇控制深度配置指南
  • 前端交互设计实现方案
  • 背包问题
  • SketchUp 2021 导入CAD图纸避坑指南:从图层清理到精准建模的完整流程
  • 别再傻傻分不清了!一张图看懂802.1、802.3、802.11到底管啥(附协议关系图)
  • D3KeyHelper:重新定义暗黑破坏神3操作体验的智能宏引擎
  • 2026年3月比较好的自建房农村别墅设计公司口碑推荐,景区房屋/自建房农村别墅,自建房农村别墅设计公司有哪些 - 品牌推荐师
  • 电解电容 vs 陶瓷电容:同样是电容,为什么用法差这么多?
  • 即时通讯软件厂家|信创国产化浪潮下,专业内网 IM 厂家该如何选
  • AI 时代,前端逆向的门槛已经低到离谱 — 以 Upwork 消息系统为例
  • 【VSCode低代码开发终极指南】:20年专家亲授5大生产力跃迁技巧,90%开发者尚未掌握
  • 2026年北京叉车出租厂家口碑推荐榜:吊车/折臂吊/大型吊车/救援车出租及1-20吨叉车出租、8-500吨汽车吊、50-300吨折臂吊出租厂家选择指南 - 海棠依旧大
  • RTC代码部分