如何失去对SlickGrid中单元格的关注 [英] How to lose focus on a cell in SlickGrid

查看:70
本文介绍了如何失去对SlickGrid中单元格的关注的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题与该问题完全相反.因此,我要尝试的是在用户从该单元格的自动完成组合框中选择一个项目之后,试图找到一种方法来失去对该单元格的关注.

My question is exactly opposite of this question. So what I'm trying is I'm trying to find a way to lose focus on a cell after user selects an item from the autocomplete combobox in that cell.

 $input.autocomplete({
                delay: 0,
                minLength: 0, 
                source: args.column.options,
                select: function (event, ui) {
                    $input.val(ui.item.label);
                   grid.getEditController().commitCurrentEdit();
              return false;
                }
            });

在完成编辑后,我使用此代码间接失去了焦点.它工作正常,但是该单元仍保持选中状态.

I used this code to lose focus indirectly after finishing with editing. It works fine, however, the cell stays selected somehow.

grid.getEditController().commitCurrentEdit();

我还尝试了下面的代码来失去焦点,但是每次运行代码时,它都会引发错误.

I also tried the code below to lose focus but it throws error everytime when I run the code.

grid.setActiveCell();
grid.setSelectedRows(-1);

从自动完成组合框中选择一个项目后,我希望网格失去焦点,并且在网格的视口中什么也不选择.

After selecting an item from the autocomplete combobox, I want the grid to lose focus and select nothing on the viewport of the grid.

非常感谢您的回答.

推荐答案

尝试调用grid.resetActiveCell().

这篇关于如何失去对SlickGrid中单元格的关注的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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