Skip to content

{ Tag Archives } WebCombo

WebCombo过滤中文不完全解决办法

NetAdvantage中有个WebCombo控件,当该控件Editable属性设为“true”时,则可以通过输入文字过滤webCombo弹出的grid中的记录。但该控件只支持英文过滤而不支持中文过滤。经试验,可以不完美的解决中文过滤问题。 首先,WebCombo的Editable要设为true,EnableXmlHTTP=”True”,ComboTypeAhead=”Suggest”。然后,编辑ClientSideEvents中的EditKeyUp事件。 ?View Code JAVASCRIPTfunction wcbCommodity_EditKeyUp(webComboId,newValue,keyCode){ //newvalue为输入文字,汉字被编码成ascii,所以要解码还原成string. var s = unescape(newValue); webComboId.selectWhere(" name like ‘%" + s + "’"); } 这样,在输入完汉字后,再输入一个空格就可以过滤中文了。那为什么要再输入空格?因为在输入汉字时,并不会产生EditKeyUp事件。而如果是用EditKeyDown事件的话,该事件中的newValue而是事件产生之前的输入框中的文字。 以上是个不完全的解决办法,不知还有什么好办法解决中文过滤

Also tagged ,

WebCombo in UltraWebGrid

在将NetAdvantage升级到2008 vol2后,发现在2008 vol1版本中能正常使用的UltraWebGrid绑定WebCombo功能,如果WebCombo的Editable属性设为true话,那么在2008 vol2版本中将会抛出异常:WebCombo has the Editable property set to True; therefore it must have equal DataTextField and DataValueField to be used as an editor in an UltraWebGrid. 经与NetAdvantage开发人员联系,已确定在2008 vol2版本中,如果WebCombo的DataValueField不与DataTextField相同的话,那么在UltraWebGrid中的WebCombo不支持Editable=true。解决办法是用2008 vol1这个版本。 NetAdvantage开发人员回信如下: The webcombo does not support editable=true, when the DataValueField is different from the DataTextField.  This is done because the user only has the [...]

Also tagged , ,