Ext技术细节记录(Extjs Small tips)
1.为毛RadioGroup动态添加Radio之后change事件点击后响应上一个Radio呢。
原因是没判断是否选中:
public static void InitIconList(Ext.Net.RadioGroup iconList) { string[] icons = new string[] { "BulletYellow", "BulletRed", "BulletPurple", "BulletPink", "BulletOrange", "BulletGreen", "BulletBlue", "BulletBlack" }; foreach (string icon in icons) { Ext.Net.Radio iconradio = new Ext.Net.Radio(new Radio.Config { IndicatorIcon = String2Icon(icon, true), SubmitValue=false, Name="IconList",IndicatorText = icon, InputValue = icon }); iconradio.Listeners.Change.Handler = "if(item.checked==true){#{txtIcon}.setValue(item.inputValue)}"; iconList.Items.Add(iconradio); } }
2.Window加载URL及页面刷新
<ext:Button runat="Server" Icon="Add" Text="新增菜单" ID="BtnNew"> <Listeners> <Click Handler="top.App.Window1.update();top.App.Window1.title='新增菜单';top.App.Window1.loader.url='SysMenu/NewMenu.aspx';top.App.Window1.show();"> </Click> </Listeners> </ext:Button>
3.ComboBox使用数据绑定时无法设置选中项(Can not select combobox items using store)
原因是数据源中的value是整数型的。设置Mod为Raw即可。
this.ComboBox1.SelectedItems.Add(new Ext.Net.ListItem() { Value = "3", Mode = ParameterMode.Raw });