Apr 27, 2011, 1:37 AM
Ask for confirmation before calling direct method
So my direct method works fine like this:
<Listeners>
<Click Handler="if(confirm('Are You Sure?'))Ext.net.DirectMethods.CreateType({
success: function (result) {Ext.Msg.alert('Manager', result);}});" />
</Listeners>
But if i don't use the built in javascript "confirm" method and instead use an Ext method, it doesn't work. The code within the confirmCreate fires, but CreateType does not appear to fire...little help?<Listeners>
<Click Handler="if(confirmCreate())Ext.net.DirectMethods.CreateType({
success: function (result) {Ext.Msg.alert('Manager', result);}});" />
</Listeners>
<script language="javascript" type="text/javascript">
function confirmCreate() {
Ext.Msg.confirm('Confirm', 'Really?', function (btn, text) {
if (btn == 'yes') {return true;}
return false;
})
}
</script>
Any help would be appreciated