Dec 12, 2012, 1:41 PM
I get it:)
Here's my configuration for now:
Here's my configuration for now:
string DisplayField = "Name";
string ValueField = "Id";
string EmptyText = "-- empty --";
string EmptyValue = 0;
Ext.Net.ComboBox combo = new Ext.Net.ComboBox();
Ext.Net.Store store = new Ext.Net.Store();
store.ID = this.ID + "_Store";
Ext.Net.JsonReader reader = new JsonReader();
combo.DisplayField = DisplayField;
combo.ValueField = ValueField;
combo.EmptyText = EmptyText;
combo.EmptyValue = EmptyValue;
reader.Fields.AddRange(new List<RecordField>{new RecordField(ValueField, RecordFieldType.Int), new RecordField(DisplayField, RecordFieldType.String)});
store.SortInfo.Direction = SortDirection.ASC;
store.SortInfo.Field = DisplayField;
store.Reader.Add(reader);
reader.IDProperty = ValueField;
Ext.Net.HttpProxy proxy = new Ext.Net.HttpProxy();
proxy.Url = "~/ComboHandler.cs";
proxy.Method = HttpMethod.POST;
proxy.Timeout = 10000;
store.Proxy.Add(proxy);
store.AutoLoad = false;
store.BaseParams["session_name_combobox"] = store.ID;
string jsonParams = JSON.Serialize(searchParams);
store.BaseParams[store.ID + "_searchparams"] = jsonParams;
combo.TriggerAction = TriggerAction.All;
1 more issue happend how to load only 1 value to combobox on server side:object o = Activator.CreateInstance(type,new object[]{1,null};//type is System.Type of my BLL Object
((MMPControls.Web.ComboBoxWithAddFeature)control.Value).Store.AddRecord(o);//here I got exception JsonSerializationException do I need serialize this 'o' element?
Last edited by ViDom; Dec 12, 2012 at 2:28 PM.