Jul 24, 2014, 5:28 AM
[CLOSED] [#529] MultiSelect scroll position is not getting maintianed
Hi,
I have a simple Multiselect list used for displaying countries.
The issue which i am facing is, when user select all the countries and want to deselect last 2 countries or first country the scroll position is not maintained.
This issue also exists in Multiselect examples on https://examples2.ext.net/
In order to reproduce this issue please deselect first & last country after selecting all the countries
Here is my sample code
Index View
I have a simple Multiselect list used for displaying countries.
The issue which i am facing is, when user select all the countries and want to deselect last 2 countries or first country the scroll position is not maintained.
This issue also exists in Multiselect examples on https://examples2.ext.net/
In order to reproduce this issue please deselect first & last country after selecting all the countries
Here is my sample code
Index View
@model List<TestProject.Controllers.MultiSelectController.Country>
@using System.Web.Optimization;
@{
ViewBag.Title = "Home Page";
var X = Html.X();
}
@(Html.X().ResourceManager(ViewBag.ManagerConfig as MvcResourceManagerConfig))
<script>
var SelectAllCountries = function () {
App.RegionList.setSelectedItems(App.RegionList.store.getAllRange())
}
var DeselectAllCountries = function () {
App.RegionList.boundList.getSelectionModel().deselectAll();
}
</script>
<h2>Multi Select</h2>
@(
Html.X().Container().ID("cntr").Items(
X.MultiSelect().ID("RegionList").Height(200).Width(300).FieldLabel("Select Coutries").LabelAlign(LabelAlign.Top)
.Items(from p in Model select new Ext.Net.ListItem { Text = p.CountryName, Value = p.CountryId.ToString() }),
X.Button().Text("Select All").ID("btnSelcetAll").Listeners(ls => ls.Click.Fn = "SelectAllCountries"),
X.Button().Text("Deselect All").ID("btnDeselectAll").Listeners(ls => ls.Click.Fn = "DeselectAllCountries")
)
)
Model & Controller: public class MultiSelectController : Controller
{
public class Country
{
public int CountryId { get; set; }
public string CountryName { get; set; }
}
public ActionResult Index()
{
List<Country> list = new List<Country>();
for (int i = 0; i <= 50; i++)
{
Country obj = new Country();
obj.CountryId=i;
obj.CountryName="Country-"+i;
list.Add(obj);
}
return View(list);
}
}
Thanks
Last edited by Daniil; Aug 05, 2014 at 1:12 PM.
Reason: [CLOSED] [#529]