Dec 21, 2015, 7:15 AM
Code behinde rendered MultiCombo with selected items not working Ext.net 2.5.3.1
Hi,
I'm rendering a Multi Combo in a propertyGrid all render with data and selected items happens in C# Codebehind, When the page loads it renders all items in the Multi Combo when I click to show the items list for the Multi Combo but no selected items shown only the value in the textfield, when I click a way from the Multi Combo and click again to show the list then I see the selected items are "Checked" but not selected "Highlighted", when I click on one list item all the old values disappears and get overridden by the new one. I tried to make it work in many ways but I couldn't make it work.
When I made a look at the browsers Developer Console "Chrome" I realized that the items list "Bound list" is not rendered from the beginning only then when I click to focus on the Multi Combo, but with no selected items, then when I click a way the and click again on the Multi Combo the bound list disappears and a new one appears with "Checked items" not selected, and the issue with the value override as described above consists alla the time.
I made a Javascript selection code to make the selection just to show you that it is missing somehow, but it make te selection right
Here is some code:
I'm rendering a Multi Combo in a propertyGrid all render with data and selected items happens in C# Codebehind, When the page loads it renders all items in the Multi Combo when I click to show the items list for the Multi Combo but no selected items shown only the value in the textfield, when I click a way from the Multi Combo and click again to show the list then I see the selected items are "Checked" but not selected "Highlighted", when I click on one list item all the old values disappears and get overridden by the new one. I tried to make it work in many ways but I couldn't make it work.
When I made a look at the browsers Developer Console "Chrome" I realized that the items list "Bound list" is not rendered from the beginning only then when I click to focus on the Multi Combo, but with no selected items, then when I click a way the and click again on the Multi Combo the bound list disappears and a new one appears with "Checked items" not selected, and the issue with the value override as described above consists alla the time.
I made a Javascript selection code to make the selection just to show you that it is missing somehow, but it make te selection right
Here is some code:
<ext:Container ID="ContainerProperty" runat="server" Layout="FitLayout">
<Items>
<ext:PropertyGrid ID="PropertyGrid_EditUser" runat="server" NameColumnWidth="250" Title="<%$ Lang: Properties %>" />
</Items>
</ext:Container>
var comboPlugins = new Ext.Net.MultiCombo();
if (companyProp != null)
parameter.Value = companyProp.PropertyValue.Replace("|", ",");
var setValues = parameter.Value.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).ToList();
if (prop.PropertySelections != null)
{
var propSelections = prop.PropertySelections;
int propIndex = 0;
foreach (PropertySelection propSel in propSelections)
{
var listItem = new Ext.Net.ListItem(Tools.GetLangText(propSel.SelectionValue), propSel.SelectionKey, propIndex);
comboPlugins.Items.Add(listItem);
if (setValues.Any(sv => sv.ToLower() == listItem.Value.ToLower()))
{
comboPlugins.SelectedItems.Add(listItem);
}
propIndex++;
}
}
comboPlugins.ID = "ComboEditCompPlugins_" + prop.PropertyId;
comboPlugins.SelectionMode = Ext.Net.MultiSelectMode.All;
Javascript for selection:$(document).on('click', '.x-form-item-input-row', function () {
if ($('.x-mcombo-item-checked')) {
$('.x-mcombo-item-checked').parent().addClass('x-boundlist-selected');
}
});
Last edited by eagleOne; Dec 21, 2015 at 7:17 AM.