显示光滑的网格2网格,失去对第二个网格的关注 [英] Slick Grid 2 grids displayed, losing focus on second grid

查看:126
本文介绍了显示光滑的网格2网格,失去对第二个网格的关注的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用光滑的网格,这非常棒,但有一个非常小的问题,我似乎无法停下来。



我显示两个网格,一个是可编辑的,当项目是'Approved'时,它们被移动到第二个网格,它是只读的。



很明显,当点击第二个网格内有复选框的单元格时,如果单元格内的复选框被点击,焦点会被重置为第一个网格。如果他们点击其他任何地方都不会做任何事情,但是如果点击该复选框,它将转移焦点。它不会改变价值,但它确实将焦点转移了。如果我删除格式化程序,它不会移动焦点...



有什么想法?



我应该看看某种自定义格式化程序?



如果需要,我可以提供截图或代码。两个网格都是独立定义的。除了这个小问题外,他们工作得很好,这似乎是因为点击了复选框(只读,无编辑器)。点击该单元格或其他单元格中的任何其他单元都不会执行任何操作。



我试过处理beforeEdit事件并忽略它。只是想知道我是否缺少某些东西。有可能是!



谢谢

解决方案

代表OP)。



我使用自定义格式化程序解决了这个问题:

<$ p $函数customFormatter(row,cell,value,columnDef,dataContext){

console.log('value'+ value);

if(value == true)
{
return'< input type ='checkbox'onclick ='return false;'id ='coding'name ='interest 'value ='编码'检查>
}
else
{
return'< input type ='checkbox'onclick ='return false;'id ='coding'name ='interest'value ='coding >中
}

}

复选框仍然显示,但它们不显示让第二格失去焦点到第一格:)

I have been using slick grid, which is excellent, but have a really minor niggling issue which I can't seem to halt.

I display two grids, one is editable and as items are 'Approved' they are then moved to the second grid, which is read-only.

All good so far... But whilst Testing it has become apparent that when clicking on cells within the second grid which have checkboxes in them the focus gets reset to the first grid if the checkbox is clicked within the cell. If they click anywhere else it doesn't do anything, but if the checkbox is clicked it shifts focus. It doesn't change the value, but it does shift focus away. If I remove the formatter it doesn't shift focus...

Any ideas?

Should I be looking at some sort of custom formatter?

I can supply screenshots or code if needed. Both grids are independently defined. They work really well apart from this minor issue which seems to be because the checkbox (read only, no editor) is clicked on. Clicking anywhere else in that cell or on other cells does nothing.

I've tried processing a beforeEdit event and ignoring that. Just wondering if there's something I'm missing. There probably is!

Thanks

解决方案

(Posted on behalf of the OP).

I solved it using a custom formatter :

function customFormatter(row,cell,value,columnDef, dataContext) {

    console.log('value '+ value);

    if(value == true)
    {
    return "<input type='checkbox' onclick='return false;' id='coding' name='interest' value='coding' checked>"
    }
    else
    {
    return "<input type='checkbox' onclick='return false;' id='coding' name='interest' value='coding'>"
    }

}

Checkboxes are still displayed but they don't make the second grid lose focus to the first grid :)

这篇关于显示光滑的网格2网格,失去对第二个网格的关注的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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