[CLOSED] Can't get PreventDefault to work in AjaxEvent

  1. #1

    [CLOSED] Can't get PreventDefault to work in AjaxEvent

    Hi

    I', having problem removing the browser contextmenu on RowContextMenu in AjaxEvent. I tried the PreventDefault = true, but it don't seem to work. My Handler creates another menu and they both gets shown at the same time.
    The same code work in other places (TreePanel). What am I doing wrong?

    grid.AjaxEvents.RowContextMenu.Event += OnContextMenu;
    grid.AjaxEvents.RowContextMenu.PreventDefault = true;
    grid.AjaxEvents.RowContextMenu.ExtraParams.Add(new Parameter("X", "e.getPageX()", ParameterMode.Raw));
    grid.AjaxEvents.RowContextMenu.ExtraParams.Add(new Parameter("Y", "e.getPageY()", ParameterMode.Raw));
    Regards
    Klavs Martens
  2. #2

    RE: [CLOSED] Can't get PreventDefault to work in AjaxEvent

    Hi,

    I think we need to review some params which presented for Listeners/AjaxEvents. Not all can be applyed directly to the components.


    In your case you can set Before handler for ajax event


    grid.AjaxEvents.RowContextMenu.Before="e.preventDe fault();";


  3. #3

    RE: [CLOSED] Can't get PreventDefault to work in AjaxEvent

    >In your case you can set Before handler for ajax event
    > grid.AjaxEvents.RowContextMenu.Before="e.preventDe fault();";

    Thanks. That fixed the problem.
  4. #4

    RE: [CLOSED] Can't get PreventDefault to work in AjaxEvent

    is this the reason why this tag causes an error now after updating from SVN?

    
    <Listeners>
          <BeforeExpand PreventDefault="true" StopEvent="true" Handler="function.... >
    </Listeners>

Similar Threads

  1. Replies: 10
    Last Post: Apr 25, 2013, 5:38 AM
  2. Replies: 0
    Last Post: May 29, 2012, 10:23 AM
  3. AjaxEvent handler in VB does not seem to work
    By dbassett74 in forum Bugs
    Replies: 1
    Last Post: Apr 21, 2009, 11:03 AM
  4. Replies: 2
    Last Post: Mar 16, 2009, 1:50 PM
  5. listener preventdefault
    By [WP]joju in forum 1.x Help
    Replies: 4
    Last Post: Mar 09, 2009, 10:42 AM

Posting Permissions