From e6bbdd3519da2e0ade4942205fbcd522372b7569 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Wed, 11 Jul 2012 18:23:49 -0500 Subject: [PATCH] for a grid in a component, cancel delete fails, issue 879, thanks simonm3 --- VERSION | 2 +- gluon/html.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index c118fb34..09a893a0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-07-11 18:21:38) dev +Version 2.00.0 (2012-07-11 18:23:46) dev diff --git a/gluon/html.py b/gluon/html.py index 860d6301..cfae261d 100644 --- a/gluon/html.py +++ b/gluon/html.py @@ -1357,10 +1357,12 @@ class A(DIV): (self['component'],self['target'] or '',d) self['_href'] = self['_href'] or '#null' elif self['callback']: + returnfalse="var e = arguments[0] || window.event; e.cancelBubble=true; if (e.stopPropagation) e.stopPropagation();" if d: - self['_onclick']="if(confirm(w2p_ajax_confirm_message||'Are you sure you want o delete this object?')){ajax('%s',[],'%s');%s};return false;" % (self['callback'],self['target'] or '',d) + self['_onclick']="if(confirm(w2p_ajax_confirm_message||'Are you sure you want o delete this object?')){ajax('%s',[],'%s');%s};%s" % \ + (self['callback'],self['target'] or '',d, returnfalse) else: - self['_onclick']="ajax('%s',[],'%s');%sreturn false;" % \ + self['_onclick']="ajax('%s',[],'%s');%sreturn false" % \ (self['callback'],self['target'] or '',d) self['_href'] = self['_href'] or '#null' elif self['cid']: