return false; for ajax onclick events
Fri, 09/18/2009 - 16:21
Hi,
I noticed today when tidying up a system I'm build that when I had AjaxControlAction in my datagrid that is quite far down a page that when you click the button the page will jump to the top.
This is because, as I'm sure you know, there is no return false; at the end of
<?php
return sprintf("qc.pA('%s', '%s', '%s', '%s', '%s');",
$objControl->Form->FormId, $objControl->ControlId, get_class($this->objEvent), addslashes($objControl->ActionParameter), $strWaitIconControlId);
?>_actions.inc.php: line 142.
Is this likely to break anything else in the framework? Or is there another method I should use to stop the page jumping back to the top?
Kind regards,
Nick

If you want it to return false, you should also be tacking on a QTerminateAction to the control as well.
Awesome, thank you :D