OnCommand fired on Enter key press in outside control

2 posts, 0 answers
  1. Alexander
    Alexander avatar
    152 posts
    Member since:
    Jun 2012

    Posted 02 Mar 2012 Link to this post

    I have textbox that directly has nothing to do with radgrid on the same page.
    Textbox has this:
    $('#" + filterControl.ClientID + @"').live('keydown', function(event) {
                                                    if (event.keyCode && event.keyCode == '13') {
                                                        return jsApplyFilterAction" + ParameterSetHolder.Group + @"();
                                                    }
                                                    else {
                                                        return true;
                                                    }
                                                });
    jsApplyFilterAction**** - method, that calls webservice for filling the grid and making some other things.

    For some strange reason when I press Enter being inside this textbox, after executing mentioned method, jsApplyFilterAction, that is ok,

    _OnCommand grid event is fired! And command name there is 'Sort'!

    As a result, I get unpredictable results and double call of webservice.

    I tried to disable _OnCommand event firing with different grid properties, but vain.

    How to get rid of this OnCommand triggering and why, after all, it's triggered?

    UPDATE: it happens in Firefox, not in IE(9). Chrome is also ok.
  2. Alexander
    Alexander avatar
    152 posts
    Member since:
    Jun 2012

    Posted 03 Mar 2012 Link to this post

    Nobody knows?

    Hmm...

    I have noticed that when I "come" to _Command method from textbox enter keypress - SortExpression is either "" or " ASC" or " DESC".
    So, the only thing I could do was checking for SortExpression validity: if its lowercased trim is "asc" or "desc" - I just do not call webservice.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top