PDA

View Full Version : [CLOSED] Selecting a contiguous range of rows in a MultiCombo list with Shift doesn't work



bogc
Jan 23, 2015, 10:58 PM
Hello:

As end user, is there a way to select a contiguous range of rows in a MultiCombo list? Usually, with other components, the gridpanel for instance, I can select a contiguous range by using the Shift key. However, it doesn't seem to work with the MultiCombo component list. Also is there a way to select all items or select none using the keyboard without having to click on each item?

To try check this http://examples2.ext.net/#/Form/ComboBox/MultiCombo/. The behaviour is the same in 3.0 : http://examples2.ext.net/#/Form/ComboBox/MultiCombo/.

Thanks

hogaf
Jan 24, 2015, 4:33 PM
Hi @bogc,

Combobox's Ext.view.BoundList (http://docs-devel.sencha.com/extjs/5.0/5.0.1-apidocs/#!/api/Ext.view.BoundList) uses Ext.view.BoundListKeyNav (http://docs-devel.sencha.com/extjs/5.0/5.0.1-apidocs/#!/api/Ext.view.BoundListKeyNav) to support keyboard navigation. so you might add custom behavior to the defaultHandlers function in BoundListKeyNav to handle the SHIFT key.



defaultHandlers: {
up: function() {
var me = this,
boundList = me.boundList,
allItems = boundList.all,
oldItem = boundList.highlightedItem,
oldItemIdx = oldItem ? boundList.indexOf(oldItem) : -1,
newItemIdx = oldItemIdx > 0 ? oldItemIdx - 1 : allItems.getCount() - 1; //wraps around
me.highlightAt(newItemIdx);
},

down: ...
home: ...
end: ...
enter: ...
}

Daniil
Jan 26, 2015, 8:20 AM
Hello everybody,

As for v3, I found the following way to set the MULTI selection mode. By default, there is the SIMPLE mode. Tested with the latest Ext.NET from the SVN trunk.

Example

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

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Store store = this.MultiCombo1.GetStore();
store.DataSource = new object[]
{
new object[] { "1", "Item 1" },
new object[] { "2", "Item 2" },
new object[] { "3", "Item 3" }
};
}
}
</script>

<!DOCTYPE html>

<html>
<head runat="server">
<title>Ext.NET v3 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:MultiCombo
ID="MultiCombo1"
runat="server"
DisplayField="text"
ValueField="value">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="value" />
<ext:ModelField Name="text" />
</Fields>
</ext:Model>
</Model>
<Reader>
<ext:ArrayReader />
</Reader>
</ext:Store>
</Store>
<Listeners>
<AfterRender Handler="this.pickerSelectionModel.setSelectionMode('MULTI' );" />
</Listeners>
</ext:MultiCombo>
</form>
</body>
</html>