Mar 20, 2009, 8:16 AM
[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
Maybe something like:
Thanx a lot
Matteo
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.