[CLOSED] Button DirectEvents: How to stop the Click Event from triggering due to certain conditions

  1. #1

    [CLOSED] Button DirectEvents: How to stop the Click Event from triggering due to certain conditions

    Hi,

    There is a button than contains a DirectEvents when the button is clicked. But for certain conditions (validation), I would like to stop the event and not call the DirectEvents. Can you advice how to accomplish this?


    var ClickTrend = function(grid){
      var index = grid.store.findExact('CheckColumnTrendingList',true);
      if(index >= 0){
        //Do stuff
      } else {
        //Ext.EventObject.stopEvent();                            //Tried this but its not working
        //Ext.getCmp('ButtonTrend').stopEvent();             //Tried this too and its not working
        Ext.Msg.alert("","Please select one item in the Option drop down box to perform a search.");
      }
    }

    HTML
      <ext:Button ID="Button1" Text="Trend" runat="server">
        <DirectEvents>
          <Click OnEvent="DE_ButtonTrend_Click" Before="ClickTrend(#{GridPanelTrendingList});">
            <ExtraParams>
              <ext:Parameter Name="Clear" Value="false" Mode="Raw" />
              <ext:Parameter Name="SelectedTestList" Value="GridPanelTrendingList.getRowsValues()" Mode="Raw" Encode="true" />
            </ExtraParams>
          </Click>
        </DirectEvents>
      </ext:Button>
    Last edited by Daniil; Nov 02, 2011 at 6:23 AM. Reason: [CLOSED]
  2. #2
    Hi,

    To stop a DirectEvent, please return false from its Before handler or a respective listener.
  3. #3
    Thanks. Please close this ticket.

Similar Threads

  1. Replies: 0
    Last Post: Jun 12, 2012, 10:00 AM
  2. triggering ASP:UpdatePanel using DirectEvents
    By cd.key in forum 1.x Help
    Replies: 0
    Last Post: Jul 08, 2011, 8:33 AM
  3. Replies: 4
    Last Post: Jul 17, 2010, 8:21 AM
  4. Button's onclick event is not triggering -
    By latif in forum 1.x Help
    Replies: 1
    Last Post: Nov 25, 2009, 12:25 PM
  5. [CLOSED] Radio button click event,
    By Etisbew in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 02, 2009, 7:56 AM

Posting Permissions