Jul 18, 2013, 10:47 AM
[CLOSED] Filters in Multiselect
Hi,
I want to filter Multiselect List in mvc with some additional requirement.
My requirement is when user select an item in multiselect & search for other item, that selected item should be maintained
For Ex:
If user has selected country "India" and search the countries starting with 'A' then multiselect should display all the countries starting with 'A' including country "India" selected.
Here is my code:
Thanks
I want to filter Multiselect List in mvc with some additional requirement.
My requirement is when user select an item in multiselect & search for other item, that selected item should be maintained
For Ex:
If user has selected country "India" and search the countries starting with 'A' then multiselect should display all the countries starting with 'A' including country "India" selected.
Here is my code:
<!DOCTYPE html>
<html>
<head>
<title>Ext.Net.MVC v2 Example</title>
</head>
<script>
var onCountryChange = function (textField, newValue, oldValue) {
var multiSelect = App.UniverseCountriesList,
store = multiSelect.getStore();
store.clearFilter();
store.filter(multiSelect.displayField, newValue);
};
</script>
<body>
@Html.X().ResourceManager()
@(Html.X().TextField().ID("TxtUnCountries").Listeners(ls => ls.Change.Fn = "onCountryChange").Width(250)),
MultiSelect1
<br />
@(Html.X().MultiSelect()
.ID("MultiSelect1")
.Store
(
X.Store().ID("strUnCountries").Model(
X.Model().Fields(
new ModelField("COUNTRY_DESC"),
new ModelField("COUNTRY_CD"),
new ModelField("REGION2_CD")
)
).DataSource(Model.CountryList))
.ListConfig(Html.X().BoundList()
.Listeners(events =>
events.ItemClick.Handler = "App.MultiSelect2.getStore().add(record.copy())"
)
)
)
</body>
</html>
Thanks
Last edited by Daniil; Jul 19, 2013 at 5:34 AM.
Reason: [CLOSED]