PDA

View Full Version : [CLOSED] MultiCombo (combo with multi select) and paging is not working



Ariel
Jan 13, 2014, 6:02 AM
We use a MultiCombo control which lets us select multiple values from a big list. The list can be more than 1000 records so we need to implement paging. Unfortunately each time the user changes page, the control loses the memory of what was previously selected.

I would really appreciate it if you would solve this at your end.

I saw online that someone found a solution but it seems very complex to implement, especially to new users like myself. This to me feels like a basic feature that needs to be solved at ext.net level.

Thank you for your consideration

Daniil
Jan 13, 2014, 11:35 AM
Hi @Ariel,

I agree with you, it looks a basic feature. Unfortunately, it is not that simple to achieve that in the context of MultiCombo.

The best we can suggest you at the moment - use a common ComboBox and save selected items manually.

Ariel
Jan 13, 2014, 2:55 PM
Hi @Ariel,

I agree with you, it looks a basic feature. Unfortunately, it is not that simple to achieve that in the context of MultiCombo.

The best we can suggest you at the moment - use a common ComboBox and save selected items manually.


Do you or someone else has sample code?

Daniil
Jan 14, 2014, 3:36 AM
It is what I meant.

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.ComboBox1.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 v2 Example</title>

<script>
var onSelect = function (comboBox, records) {
var data = records[0].data;

App.MultiCombo1.addItem(data[comboBox.displayField], data[comboBox.valueField]);
App.MultiCombo1.selectAll();
};
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:ComboBox
ID="ComboBox1"
runat="server"
DisplayField="text"
ValueField="value"
FieldLabel="Pick one">
<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>
<Select Fn="onSelect" />
</Listeners>
</ext:ComboBox>

<ext:MultiCombo
ID="MultiCombo1"
runat="server"
MultiSelect="true"
FieldLabel="Picked" />
</form>
</body>
</html>


The example is not complete. It requires, at least, validation to avoid checking the same item twice and a possibility to uncheck the items.