简体   繁体   English

ExtJS 4.1-编辑单元格时消失的选择(组合框编辑器)

[英]ExtJS 4.1 - Disappearing selection when editing cell (ComboBox editor)

I have GridPanel with 2 columns : 我有2列的GridPanel:

  1. Type : string 类型:字符串
  2. Details : combo 详细信息:组合

I added CheckBox selection model and I have a little problem. 我添加了CheckBox选择模型,但有一个小问题。

When I select couple rows and want to edit Details column in some of the selected row or even not-selected, selection disappears. 当我选择几行并且想要编辑某些选定行甚至未选中的“详细信息”列时,选择消失。 Only edited row remain selected. 仅保留已编辑的行。 I can't find any solution for this. 我找不到任何解决方案。 Can anyone help me ? 谁能帮我 ?

JSFiddle : http://jsfiddle.net/papcio28/fkJT3/6/ JSFiddle: http : //jsfiddle.net/papcio28/fkJT3/6/

Your problem is that the editing model and checkbox selection model and not compatible. 您的问题是编辑模型和复选框选择模型不兼容。 The technical reason for this is that the checkbox model uses the rowselection model on the grid and grideditor uses cellselection model on the grid. 这样做的技术原因是,复选框模型在网格上使用行选择模型,而网格编辑器在网格上使用单元格选择模型。 I don't think that Extjs is compatible with your requirements here since the cell selection model is necessary for the grid to know where to put an editor and row selection model is necessary for you to visually see the selection when using checkbox selection model. 我认为Extjs与您的要求不兼容,因为网格必须知道单元格选择模型,才能知道在哪里放置编辑器,并且在使用复选框选择模型时从视觉上看到选择,行选择模型也是必需的。 In your example it sounds like it choses the row selection model, which means it selects the row when you start editing because the row has to be selected for it to know where to the put the editor. 在您的示例中,听起来好像选择了行选择模型,这意味着您在开始编辑时就选择了该行,因为必须选择该行才能知道将编辑器放置在何处。

My suggestion for you is to use checkcolumn plugin and fake the rows being selected by using a renderer on every column that changes the background to the selected color when the value for your checkcolumn is true, this way it will look like a row selection model, but not actually be one. 我的建议是使用checkcolumn插件,并在每个列上使用渲染器来伪造正在选择的行,当您的checkcolumn值为true时,它将背景更改为选定的颜色,这样,它看起来就像一个行选择模型,但实际上不是一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM