[CLOSED] Conditional AjaxEvent Confirmation

  1. #1

    [CLOSED] Conditional AjaxEvent Confirmation

    Hi Vald,

    according to this post:

    http://forums.ext.net/showthread.php?1613

    is now possible to set confirmation for AjaxEvent. Fine.

    In my case I found your script more usefull because I have to conditionally set if showing or not the Confirmation Ext alert.

    This line of code gives me error: ajaxEvents.click is null

    
    function continueAjaxEvent(btnId, text, sender, e) {
        if (btnId == 'yes') {
            sender.ajaxEvents.click.fn.apply(sender, [sender, e]);
        }
    }
    in confirmClick funcion I need something like:

    
    function confirmClick(button, e) {
    
    // don't need to show confirm
        if (myCondition)  
        {
            return true; 
        }
       else
       {
        
               Ext.Msg.confirm(
                    "CONFIRM",
                    "Are you sure?",
                    continueAjaxEvent.createDelegate(button, [button, e], true),
                    button
                );
        return false;
        }
    }
    As a request, is it possible to add a property "Condition" to AjaxEvent Confirmation?

    Maybe something like:

    
    <Confirmation 
                            ConfirmRequest="true" 
                            Title="Confirm" 
                            Message="Are you sure?" 
                            Condition="{myTextField.getValue() != ''}" /> 
    
    // OR more then one
    
    
    
    <Confirmation 
    
                            ConfirmRequest="true" 
    
                            Title="Confirm" 
    
                            Message="Are you sure?" 
    
                            > 
       <Conditions>
            <Condition Code="{myTextField.getValue() != ''}" />
            <Condition Code="{myStore.getCount() > 0}" />
       </Conditions>
    </Confirmation>
    However, for the moment I need the confirmClick function working.

    Thanx a lot

    Matteo
    Last edited by geoffrey.mcgill; Feb 20, 2011 at 4:15 PM.
  2. #2

    RE: [CLOSED] Conditional AjaxEvent Confirmation

    Hi Matteo,

    1. About example just change arumnets in continueAjaxEvent function

    Old version

    function continueAjaxEvent(btnId, text, sender, e)
    New version

    function continueAjaxEvent(btnId, text, buttonCfg, sender, e)
    2. We have added BeforeConfirm property to Confirmation object, you can return false to suppress confirmation

    <ext:Checkbox ID="Checkbox1" runat="server" BoxLabel="Show confirmation"></ext:Checkbox>
    
    <ext:Button ID="Button1" runat="server" Text="Ajax event with confirmation">
        <AjaxEvents>
            <Click OnEvent="Button1_Click">
                <Confirmation 
                    ConfirmRequest="true" 
                    BeforeConfirm="return #{Checkbox1}.getValue();"
                    Title="Title" 
                    Message="Message" />
            </Click>
        </AjaxEvents>
    </ext:Button>
    Please update from SVN

  3. #3

    RE: [CLOSED] Conditional AjaxEvent Confirmation

    Hi Vlad,

    great, thank you.

    Matteo

Similar Threads

  1. [CLOSED] Conditional Confirmation
    By rmelancon in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 12, 2011, 2:46 PM
  2. Conditional RowExpander on GridPanel
    By deejayns in forum 1.x Help
    Replies: 0
    Last Post: Sep 29, 2010, 5:02 PM
  3. [CLOSED] GridPanel conditional edit
    By sharif in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 20, 2010, 1:05 PM
  4. [CLOSED] CheckboxSelectionModel + conditional select
    By reinout.mechant@imprss.be in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 02, 2009, 6:09 AM
  5. Conditional AjaxEvents
    By grmontero in forum 1.x Help
    Replies: 1
    Last Post: May 29, 2009, 10:40 AM

Posting Permissions