PDA

View Full Version : [CLOSED] Can't select items in combobox in gridpanel's component column using arrow keys



alscg
Jul 01, 2013, 10:26 AM
Hi,

I am using grid panel in which I have component column which has a combobox as component.
When I reach to combobox and select any value using arrow key and press enter then cursor is navigating
to another combobox in next row instead of selecting value for selected item from combobox.
Please suggest the way to select any value in combobox using arrow keys.

Daniil
Jul 01, 2013, 4:09 PM
Hi @alscg,

It behaves in this manner due to the onEnterKey function.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.grid.plugin.Editing-method-onEnterKey

I can suggest you to override this function to get the behavior you need.

Here you can find some details regarding the problem.
http://www.sencha.com/forum/showthread.php?256865

Daniil
Jul 05, 2013, 5:17 AM
Finally, I think the problem is in a ComponentColumn, not in ExtJS.

Here is a test case. It reproduces two issues.

1. No way to select a ComboBox's item by Enter. Moreover, Enter focuses a ComboBox of next rows.

2. Focus a ComboBox and press Tab => a JavaScript error occurs.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Store store = this.GridPanel1.GetStore();
store.DataSource = new object[]
{
new object[] { "test1", "test2", "test3" },
new object[] { "test4", "test5", "test6" },
new object[] { "test7", "test8", "test9" }
};
}
}
</script>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:GridPanel ID="GridPanel1" runat="server">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="test1" />
<ext:ModelField Name="test2" />
<ext:ModelField Name="test3" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="Test1" DataIndex="test1" />

<ext:ComponentColumn runat="server" Text="Test2" DataIndex="test2">
<Component>
<ext:ComboBox runat="server">
<Items>
<ext:ListItem Text="Item 1" />
<ext:ListItem Text="Item 2" />
</Items>
</ext:ComboBox>
</Component>
</ext:ComponentColumn>

<ext:Column runat="server" Text="Test3" DataIndex="test3" />
</Columns>
</ColumnModel>
</ext:GridPanel>
</form>
</body>
</html>

Vladimir
Jul 05, 2013, 4:59 PM
Enter functionality can be fixed by setting MoveEditorOnEnter="false" for ComponentColumn
We will fix Enter without that property

Vladimir
Jul 05, 2013, 6:14 PM
Both issues are fixed in SVN