Monday, March 26, 2012

ListSearchExtender it seems that onchange event is not fired on DropDown

I'm using ListSearchExtender and seems that onchange is not fired when you type in DropDown. Is it a known bug? Is there any work around?

This is a known issue and we are planning to fix it. You could work around it by changing the code to fire the event in _searchForTypedText after the selected index has been set. Thanks.
Thanks. I'll just wait for fix. Is new version of Ajax Toolkit coming in the beging of april?

Personally, I'd rather put it in _onKeyPress, like this:

if

(e.charCode == Sys.UI.Key.enter || e.charCode == Sys.UI.Key.tab) {

element.onchange(

this);

}

Or _onBlur


Sorry... better yet.

In _onBlur after removing the prompt div, you can use this:

if

(this._originalIndex !=this._newIndex) {

element.onchange(this);

}


My way to fire the onChange is to call the same javascripts function in bothonChange andonKeyUp:

<asp:ListBoxid="ListBox1"runat="server"onChange="DoSomething(this)"onKeyUp="DoSomething(this)"></asp:ListBox>

<cc1:listsearchextenderid="ListSearchExtender1"runat="server"TargetControlID="ListBox1"PromptCssClass="listSearch"></cc1:listsearchextender>


The list box extender now fires the change event and you should not need to workaround this anymore. Please download the latest version of the Toolkit which contains this fix.

No comments:

Post a Comment