我有一个可以为所有美国城市提供价值的组合框。在这个组合框中,我想显示'None Selected‘作为第一个值,其他值应该排序为alphabetically.So,我需要在对商店进行排序时排除'None selected’。如何在ext js排序中实现这一点?
发布于 2013-12-23 15:40:25
对于Asp.Net MVC,我使用这样的方式:
var myList= (List<Country>())CommonLogic.GetAllCountries();
myList.Add(new Country() {Id = -1, Name= "None selected" });
myList= liste.OrderBy(p => p.Id).ToList();
ViewData["countries"] = myList;或者您可以使用emptyText选项:
var countryCombo = Ext.create('Ext.form.field.ComboBox', {
fieldLabel: 'Country',
renderTo: 'countryCombo ',
displayField: 'Name',
width: 500,
labelWidth: 130,
store: store,
queryMode: 'local',
typeAhead: true,
emptyText : 'None Selected'
});https://stackoverflow.com/questions/20746497
复制相似问题